Skip to content
This repository has been archived by the owner on Sep 26, 2020. It is now read-only.

Commit

Permalink
Merge branch 'ind-update' of github.com:fullcontact/fullcontact4j int…
Browse files Browse the repository at this point in the history
…o ind-update
  • Loading branch information
MattSainz committed Oct 24, 2017
2 parents 9a86354 + 060bf38 commit e58657b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
Expand Up @@ -5,15 +5,19 @@

@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
@EqualsAndHashCode
@ToString
public class Organization {
private String name;
private String startDate;
private boolean current;
private String endDate;
private String title;
@Getter private String name;
@Getter private String startDate;
@Getter private boolean current;
@Getter private String endDate;
@Getter private String title;
@JsonProperty("isPrimary")
private boolean isPrimary;

@JsonProperty("isPrimary")
public boolean isPrimary() {
return isPrimary;
}
}
@@ -1,6 +1,5 @@
package com.fullcontact.api.libs.fullcontact4j;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fullcontact.api.libs.fullcontact4j.enums.CardReaderQuality;
import com.fullcontact.api.libs.fullcontact4j.http.WebhookResponse;
import com.fullcontact.api.libs.fullcontact4j.http.cardreader.CardReaderFullResponse;
Expand All @@ -21,13 +20,18 @@
import com.fullcontact.api.libs.fullcontact4j.http.name.NameStatsResponse;
import com.fullcontact.api.libs.fullcontact4j.http.person.PersonResponse;
import com.fullcontact.api.libs.fullcontact4j.http.person.model.Macromeasures;
import com.fullcontact.api.libs.fullcontact4j.http.person.model.Organization;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.SneakyThrows;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.io.IOException;
import java.util.Collections;

import static org.junit.Assert.*;

public class ResponseModelTest {
public static ObjectMapper mapper = new ObjectMapper();

Expand Down Expand Up @@ -204,6 +208,16 @@ public void locationNormalizationDeserializationTest() throws Exception {
assertEquals("US", r.getCountry().getCode());
}

@Test
@SneakyThrows
public void testOrganisationSerialization() {
Organization organization = new Organization("test", null, true, null, null, true);

String actual = new ObjectMapper().writeValueAsString(organization);
assertEquals("{\"name\":\"test\",\"startDate\":null,\"current\":true," +
"\"endDate\":null,\"title\":null,\"isPrimary\":true}", actual);
}

@Test
public void accountStatsDeserializationTest() throws Exception {
AccountStatsResponse r = mapper.readValue(Utils.loadFile("example-account-stats-response.json"), AccountStatsResponse.class);
Expand Down

0 comments on commit e58657b

Please sign in to comment.