From 26260b18d74d950f5b9fcd99727f91006bce535e Mon Sep 17 00:00:00 2001 From: john Date: Wed, 24 Apr 2019 17:32:27 -0400 Subject: [PATCH] PB-26352. Cleanup Code --- .../com/silanis/esl/api/util/JacksonUtil.java | 4 +- .../com/silanis/esl/sdk/internal/Support.java | 30 +++---- .../silanis/esl/sdk/internal/UrlTemplate.java | 10 +-- .../silanis/esl/sdk/AuthenticationTest.java | 63 +++++++------- .../esl/sdk/CeremonyLayoutSettingsTest.java | 2 +- .../com/silanis/esl/sdk/DocumentTypeTest.java | 7 +- .../com/silanis/esl/sdk/SenderInfoTest.java | 2 +- .../AttachmentRequirementBuilderTest.java | 5 +- .../esl/sdk/builder/SignatureBuilderTest.java | 60 ++++++------- ...nformationForEquifaxCanadaBuilderTest.java | 25 +++--- ...erInformationForEquifaxUSABuilderTest.java | 25 +++--- .../internal/FileDocumentSourceTest.java | 3 +- .../internal/StreamDocumentSourceTest.java | 23 ----- .../AttachmentRequirementConverterTest.java | 38 ++++----- .../AuthenticationConverterTest.java | 2 +- .../AuthenticationMethodConverterTest.java | 17 ++-- .../BasePackageTypeConverterTest.java | 17 ++-- .../CeremonyLayoutSettingsConverterTest.java | 22 ++--- .../converter/ChallengeConverterTest.java | 20 ++--- .../CompletionReportConverterTest.java | 4 +- .../ConditionalFieldConverterTest.java | 61 +++++++------- .../converter/CustomFieldConverterTest.java | 34 ++++---- .../DelegationEventReportConverterTest.java | 20 ++--- .../DelegationReportConverterTest.java | 33 ++++---- .../DelegationUserConverterTest.java | 35 ++++---- .../converter/DocumentConverterTest.java | 68 +++++++-------- .../DocumentPackageConverterTest.java | 68 ++++++++------- .../converter/ErrorConverterTest.java | 42 +++++----- .../EventNotificationConfigConverterTest.java | 21 +++-- .../EventNotificationConverterTest.java | 17 ++-- .../converter/ExternalConverterTest.java | 36 ++++---- .../FieldConditionConverterTest.java | 8 +- .../converter/FieldConverterTest.java | 32 +++---- .../converter/GroupConverterTest.java | 20 ++--- .../converter/GroupSummaryConverterTest.java | 20 ++--- .../converter/ImageConverterTest.java | 21 +++-- ...ledgeBasedAuthenticationConverterTest.java | 84 +++++++++---------- ...asedAuthenticationStatusConverterTest.java | 17 ++-- .../converter/MessageConverterTest.java | 59 ++++++------- .../converter/MessageStatusConverterTest.java | 17 ++-- .../NotaryJournalEntryConverterTest.java | 43 +++++----- .../converter/PackageStatusConverterTest.java | 17 ++-- .../RequirementStatusConverterTest.java | 17 ++-- .../converter/SenderConverterTest.java | 62 +++++++------- .../converter/SenderStatusConverterTest.java | 17 ++-- .../converter/SenderTypeConverterTest.java | 17 ++-- .../converter/SignatureConverterTest.java | 28 +++---- .../converter/SignerConverterTest.java | 18 ++-- ...ormationForEquifaxCanadaConverterTest.java | 64 +++++++------- ...InformationForEquifaxUSAConverterTest.java | 64 +++++++------- .../SupportConfigurationConverterTest.java | 21 +++-- .../converter/TextAnchorConverterTest.java | 44 +++++----- .../converter/UsageReportConverterTest.java | 9 +- .../converter/VisibilityConverterTest.java | 17 ++-- .../examples/ConditionalFieldExampleTest.java | 8 +- .../DocumentExtractionExampleTest.java | 18 ++-- ...ntNotificationRegistrationExampleTest.java | 4 +- .../SenderManipulationExampleTest.java | 2 +- .../esl/sdk/examples/TemplateExampleTest.java | 4 +- 59 files changed, 761 insertions(+), 805 deletions(-) delete mode 100644 sdk/src/test/java/com/silanis/esl/sdk/builder/internal/StreamDocumentSourceTest.java diff --git a/sdk/src/main/java/com/silanis/esl/api/util/JacksonUtil.java b/sdk/src/main/java/com/silanis/esl/api/util/JacksonUtil.java index 22b49322c..8cf804d19 100644 --- a/sdk/src/main/java/com/silanis/esl/api/util/JacksonUtil.java +++ b/sdk/src/main/java/com/silanis/esl/api/util/JacksonUtil.java @@ -146,9 +146,7 @@ public static Map merge(Map baseMap, Map resultList = (List) resultMap.get(key); - for ( Object object : (List)value ) { - resultList.add(object); - } + resultList.addAll((List) value); } else { resultMap.put(key, value); } diff --git a/sdk/src/main/java/com/silanis/esl/sdk/internal/Support.java b/sdk/src/main/java/com/silanis/esl/sdk/internal/Support.java index d2fc7d041..7bcacfffd 100644 --- a/sdk/src/main/java/com/silanis/esl/sdk/internal/Support.java +++ b/sdk/src/main/java/com/silanis/esl/sdk/internal/Support.java @@ -1,10 +1,11 @@ package com.silanis.esl.sdk.internal; -import java.util.logging.Level; -import java.util.logging.Logger; import org.apache.http.Header; import org.apache.http.client.methods.HttpUriRequest; +import java.util.logging.Level; +import java.util.logging.Logger; + public class Support { private static Logger LOG = Logger.getLogger(Support.class.getName()); @@ -15,23 +16,23 @@ public void log(HttpUriRequest request) { } private String formatHeaders(Header[] allHeaders) { - if(allHeaders != null){ - String formattedHeaders = "{"; + if (allHeaders != null) { + StringBuilder formattedHeaders = new StringBuilder("{"); for (Header allHeader : allHeaders) { - formattedHeaders += "["; + formattedHeaders.append("["); final String name = allHeader.getName(); - if(name != null){ - formattedHeaders += name; + if (name != null) { + formattedHeaders.append(name); } - formattedHeaders += "="; + formattedHeaders.append("="); final String value = allHeader.getValue(); - if(value != null){ - formattedHeaders += value; + if (value != null) { + formattedHeaders.append(value); } - formattedHeaders += "]"; + formattedHeaders.append("]"); } - formattedHeaders += "}"; - return formattedHeaders; + formattedHeaders.append("}"); + return formattedHeaders.toString(); } return ""; } @@ -39,6 +40,7 @@ private String formatHeaders(Header[] allHeaders) { public void logRequest(String httpVerb, String path, String jsonPayload) { LOG.log(Level.FINE, "{0} on {1}\n {2}", new Object[]{httpVerb, path, jsonPayload}); } + public void logRequest(String httpVerb, String path) { LOG.log(Level.FINE, "{0} on {1}", new Object[]{httpVerb, path}); } @@ -47,7 +49,7 @@ public void logResponse(String response) { LOG.fine("RESPONSE: \n" + response); } - public void logError( com.silanis.esl.api.model.Error errorMessage){ + public void logError(com.silanis.esl.api.model.Error errorMessage) { LOG.severe("message:" + errorMessage.getMessage() + ", http code:" + errorMessage.getCode()); } diff --git a/sdk/src/main/java/com/silanis/esl/sdk/internal/UrlTemplate.java b/sdk/src/main/java/com/silanis/esl/sdk/internal/UrlTemplate.java index 843f2eae5..654e1fff7 100644 --- a/sdk/src/main/java/com/silanis/esl/sdk/internal/UrlTemplate.java +++ b/sdk/src/main/java/com/silanis/esl/sdk/internal/UrlTemplate.java @@ -179,23 +179,23 @@ public UrlTemplate addParam(String paramKey, String paramValue) { } public String build() { - String url = baseUrl + path; + StringBuilder url = new StringBuilder(baseUrl + path); boolean isFirstParam = true; for (Map.Entry param : params.entrySet()) { final String paramValue = param.getValue(); if (isNotBlank(paramValue)) { if (isFirstParam) { - url += "?"; + url.append("?"); isFirstParam = false; } else { - url += "&"; + url.append("&"); } - url += param.getKey() + "=" + paramValue; + url.append(param.getKey()).append("=").append(paramValue); } } - return url; + return url.toString(); } } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/AuthenticationTest.java b/sdk/src/test/java/com/silanis/esl/sdk/AuthenticationTest.java index d932f4402..6e9f0b9f0 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/AuthenticationTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/AuthenticationTest.java @@ -8,16 +8,15 @@ import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.core.Is.is; public class AuthenticationTest { @Test public void constructorWithMethod() { - for ( AuthenticationMethod authenticationMethod : AuthenticationMethod.values() ) { - Authentication authentication = new Authentication( authenticationMethod ); - assertThat( "method is not set correctly for " + authenticationMethod.name(), authentication.getMethod(), is( equalTo( authenticationMethod ) ) ); + for (AuthenticationMethod authenticationMethod : AuthenticationMethod.values()) { + Authentication authentication = new Authentication(authenticationMethod); + assertThat("method is not set correctly for " + authenticationMethod.name(), authentication.getMethod(), is(authenticationMethod)); } } @@ -25,22 +24,22 @@ public void constructorWithMethod() { private Authentication newChallengeAuthentication() { challenges = new ArrayList(); - challenges.add( new Challenge( "one", "two" ) ); - challenges.add( new Challenge( "three", "four" ) ); - challenges.add( new Challenge( "four", "five" ) ); - return new Authentication( challenges ); + challenges.add(new Challenge("one", "two")); + challenges.add(new Challenge("three", "four")); + challenges.add(new Challenge("four", "five")); + return new Authentication(challenges); } @Test public void constructorWithListOfChallenges() { Authentication authentication = newChallengeAuthentication(); - assertThat( "method not set correctly", authentication.getMethod(), is( equalTo( AuthenticationMethod.CHALLENGE ) ) ); - assertThat( "challenges list is null", authentication.getChallenges(), is( notNullValue() ) ); - assertThat( "challenges list is wrong size", authentication.getChallenges().size(), is( equalTo( challenges.size() ) ) ); - for ( int i = 0; i < challenges.size(); i++ ) { - assertThat( "challenge question #" + i + " is not set correctly", authentication.getChallenges().get( i ).getQuestion(), is( equalTo( challenges.get( i ).getQuestion() ) ) ); - assertThat( "challenge answer #" + i + " is not set correctly", authentication.getChallenges().get( i ).getAnswer(), is( equalTo( challenges.get( i ).getAnswer() ) ) ); + assertThat("method not set correctly", authentication.getMethod(), is(AuthenticationMethod.CHALLENGE)); + assertThat("challenges list is null", authentication.getChallenges(), notNullValue()); + assertThat("challenges list is wrong size", authentication.getChallenges().size(), is(challenges.size())); + for (int i = 0; i < challenges.size(); i++) { + assertThat("challenge question #" + i + " is not set correctly", authentication.getChallenges().get(i).getQuestion(), is(challenges.get(i).getQuestion())); + assertThat("challenge answer #" + i + " is not set correctly", authentication.getChallenges().get(i).getAnswer(), is(challenges.get(i).getAnswer())); } } @@ -48,40 +47,40 @@ public void constructorWithListOfChallenges() { public Authentication newSMSAuthentication() { phoneNumber = "1234567890"; - return new Authentication( phoneNumber ); + return new Authentication(phoneNumber); } @Test public void constructorWithTelephoneNumber() { Authentication authentication = newSMSAuthentication(); - assertThat( "authentication method is not being set to sms", authentication.getMethod(), is( equalTo( AuthenticationMethod.SMS ) ) ); - assertThat( "phone number is not set correctly", authentication.getPhoneNumber(), is( equalTo( phoneNumber ) ) ); + assertThat("authentication method is not being set to sms", authentication.getMethod(), is(AuthenticationMethod.SMS)); + assertThat("phone number is not set correctly", authentication.getPhoneNumber(), is(phoneNumber)); } private Authentication newEmailAuthentication() { - return new Authentication( AuthenticationMethod.EMAIL ); + return new Authentication(AuthenticationMethod.EMAIL); } @Test public void emailAuthToAPIAuth() { Authentication authentication = newEmailAuthentication(); Auth auth = new AuthenticationConverter(authentication).toAPIAuthentication(); - assertThat("Null value was returned by converter", auth, is(notNullValue())); - assertThat( "AuthScheme was not set to NONE", auth.getScheme(), is( equalTo( "NONE" ) ) ); + assertThat("Null value was returned by converter", auth, notNullValue()); + assertThat("AuthScheme was not set to NONE", auth.getScheme(), is("NONE")); } @Test public void challengeAuthToAPIAuth() { Authentication authentication = newChallengeAuthentication(); Auth auth = new AuthenticationConverter(authentication).toAPIAuthentication(); - assertThat("Null value was returned by converter", auth, is(notNullValue())); - assertThat( "AuthScheme was not set to CHALLENGE", auth.getScheme(), is( equalTo( "CHALLENGE" ) ) ); - assertThat( "Challenge list was set to null", auth.getChallenges(), is( notNullValue() ) ); - assertThat( "Challenge list did not contain the expected number of elements", auth.getChallenges().size(), is( equalTo( challenges.size() ) ) ); - for ( int i = 0; i < challenges.size(); i++ ) { - assertThat( "Challenge question #" + i + " + was not set correctly", auth.getChallenges().get( i ).getQuestion(), is( equalTo( challenges.get( i ).getQuestion() ) ) ); - assertThat( "Challenge answer #" + i + " + was not set correctly", auth.getChallenges().get( i ).getAnswer(), is( equalTo( challenges.get( i ).getAnswer() ) ) ); + assertThat("Null value was returned by converter", auth, notNullValue()); + assertThat("AuthScheme was not set to CHALLENGE", auth.getScheme(), is("CHALLENGE")); + assertThat("Challenge list was set to null", auth.getChallenges(), notNullValue()); + assertThat("Challenge list did not contain the expected number of elements", auth.getChallenges().size(), is(challenges.size())); + for (int i = 0; i < challenges.size(); i++) { + assertThat("Challenge question #" + i + " + was not set correctly", auth.getChallenges().get(i).getQuestion(), is(challenges.get(i).getQuestion())); + assertThat("Challenge answer #" + i + " + was not set correctly", auth.getChallenges().get(i).getAnswer(), is(challenges.get(i).getAnswer())); } } @@ -89,10 +88,10 @@ public void challengeAuthToAPIAuth() { public void smsAuthToAPIAuth() { Authentication authentication = newSMSAuthentication(); Auth auth = new AuthenticationConverter(authentication).toAPIAuthentication(); - assertThat("AuthScheme was not set to SMS", auth.getScheme(), is(equalTo("SMS"))); - assertThat( "Challenges list was null (should hold phone number)", auth.getChallenges(), notNullValue() ); - assertThat( "Challenges list was not length 1", auth.getChallenges().size(), is( equalTo( 1 ) ) ); - assertThat( "First challenge item should hold the phone number as question, but didn't", auth.getChallenges().get( 0 ).getQuestion(), is( equalTo( phoneNumber ) ) ); - assertThat( "First challenge answer should be blank", auth.getChallenges().get( 0 ).getAnswer(), is( notNullValue() ) ); + assertThat("AuthScheme was not set to SMS", auth.getScheme(), is("SMS")); + assertThat("Challenges list was null (should hold phone number)", auth.getChallenges(), notNullValue()); + assertThat("Challenges list was not length 1", auth.getChallenges().size(), is(1)); + assertThat("First challenge item should hold the phone number as question, but didn't", auth.getChallenges().get(0).getQuestion(), is(phoneNumber)); + assertThat("First challenge answer should be blank", auth.getChallenges().get(0).getAnswer(), notNullValue()); } } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/CeremonyLayoutSettingsTest.java b/sdk/src/test/java/com/silanis/esl/sdk/CeremonyLayoutSettingsTest.java index b9d9c799d..7604c55d9 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/CeremonyLayoutSettingsTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/CeremonyLayoutSettingsTest.java @@ -125,7 +125,7 @@ public void toAPILayoutOptions() { settings.setShowGlobalConfirmButton( true ); settings.setShowGlobalDownloadButton( true ); settings.setShowGlobalSaveAsLayoutButton( true ); - LayoutOptions layoutOptions = layoutOptions = new CeremonyLayoutSettingsConverter(settings).toAPILayoutOptions(); + LayoutOptions layoutOptions = new CeremonyLayoutSettingsConverter(settings).toAPILayoutOptions(); assertThat( "", layoutOptions.getBrandingBar().getLogo().getLink(), is( equalTo( settings.getLogoImageLink() ) ) ); } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/DocumentTypeTest.java b/sdk/src/test/java/com/silanis/esl/sdk/DocumentTypeTest.java index ba2ba46ba..27f55032d 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/DocumentTypeTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/DocumentTypeTest.java @@ -3,23 +3,22 @@ import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; public class DocumentTypeTest { @Test public void normalizingNameReplacesWhitespaceWithUnderscores() { - assertThat(DocumentType.PDF.normalizeName("Some File.pdf"), is(equalTo("Some_File.pdf"))); + assertThat(DocumentType.PDF.normalizeName("Some File.pdf"), is("Some_File.pdf")); } @Test public void appendsExtensionWhenNoneIsFound() { - assertThat(DocumentType.PDF.normalizeName("Some File"), is(equalTo("Some_File.pdf"))); + assertThat(DocumentType.PDF.normalizeName("Some File"), is("Some_File.pdf")); } @Test public void doesNotAppendExtraDotWhenOneIsFoundAtNameEnd() { - assertThat(DocumentType.WORD.normalizeName("Some File."), is(equalTo("Some_File.docx"))); + assertThat(DocumentType.WORD.normalizeName("Some File."), is("Some_File.docx")); } } \ No newline at end of file diff --git a/sdk/src/test/java/com/silanis/esl/sdk/SenderInfoTest.java b/sdk/src/test/java/com/silanis/esl/sdk/SenderInfoTest.java index 06fc1cb37..d7f40a03f 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/SenderInfoTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/SenderInfoTest.java @@ -63,7 +63,7 @@ public void testToAPI() { Sender sender = new SenderConverter(senderInfo).toAPISender(); - assertThat("first name was not properly set or retrieved", sender.getFirstName(), is(equalTo("firstName"))); + assertThat("first name was not properly set or retrieved", sender.getFirstName(), is("firstName")); assertThat( "last name was not properly set or retrieved", sender.getLastName(), is( equalTo( "lastName" ) ) ); assertThat( "company was not properly set or retrieved", sender.getCompany(), is( equalTo( "company" ) ) ); assertThat( "title was not properly set or retrieved", sender.getTitle(), is( equalTo( "title" ) ) ); diff --git a/sdk/src/test/java/com/silanis/esl/sdk/builder/AttachmentRequirementBuilderTest.java b/sdk/src/test/java/com/silanis/esl/sdk/builder/AttachmentRequirementBuilderTest.java index edc0970aa..d89f16845 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/builder/AttachmentRequirementBuilderTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/builder/AttachmentRequirementBuilderTest.java @@ -5,7 +5,6 @@ import org.junit.Test; import static com.silanis.esl.sdk.builder.AttachmentRequirementBuilder.newAttachmentRequirementWithName; -import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -25,8 +24,8 @@ public void buildWithSpecificValues() { .isRequiredAttachment() .build(); - assertThat("Attachment's name was not set correctly.", attachmentRequirement.getName(), is(equalTo(name))); - assertThat("Attachment's description was not set correctly.", attachmentRequirement.getDescription(), is(equalTo(description))); + assertThat("Attachment's name was not set correctly.", attachmentRequirement.getName(), is(name)); + assertThat("Attachment's description was not set correctly.", attachmentRequirement.getDescription(), is(description)); assertThat("Attachment's required property was not set correctly", attachmentRequirement.isRequired(), is(isRequired)); } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/builder/SignatureBuilderTest.java b/sdk/src/test/java/com/silanis/esl/sdk/builder/SignatureBuilderTest.java index 5ff74c17e..9108995af 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/builder/SignatureBuilderTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/builder/SignatureBuilderTest.java @@ -25,10 +25,10 @@ public void buildCaptureForPlaceholder() { Placeholder placeholder = new Placeholder("placeholderId"); Signature signature = captureFor(placeholder).build(); - assertThat(signature, is(notNullValue())); - assertThat(signature.getRoleId(), is(equalTo(placeholder))); + assertThat(signature, notNullValue()); + assertThat(signature.getRoleId(), is(placeholder)); assertThat(signature.getSignerEmail(), isEmptyOrNullString()); - assertThat(signature.getStyle(), is(equalTo(SignatureStyle.HAND_DRAWN))); + assertThat(signature.getStyle(), is(SignatureStyle.HAND_DRAWN)); } @Test @@ -36,10 +36,10 @@ public void buildSignatureForPlaceholder() { Placeholder placeholder = new Placeholder("placeholderId"); Signature signature = signatureFor(placeholder).build(); - assertThat(signature, is(notNullValue())); - assertThat(signature.getRoleId(), is(equalTo(placeholder))); + assertThat(signature, notNullValue()); + assertThat(signature.getRoleId(), is(placeholder)); assertThat(signature.getSignerEmail(), isEmptyOrNullString()); - assertThat(signature.getStyle(), is(equalTo(SignatureStyle.FULL_NAME))); + assertThat(signature.getStyle(), is(SignatureStyle.FULL_NAME)); } @Test @@ -47,10 +47,10 @@ public void buildAcceptanceForPlaceholder() { Placeholder placeholder = new Placeholder("placeholderId"); Signature signature = SignatureBuilder.acceptanceFor(placeholder).build(); - assertThat(signature, is(notNullValue())); - assertThat(signature.getRoleId(), is(equalTo(placeholder))); + assertThat(signature, notNullValue()); + assertThat(signature.getRoleId(), is(placeholder)); assertThat(signature.getSignerEmail(), isEmptyOrNullString()); - assertThat(signature.getStyle(), is(equalTo(SignatureStyle.ACCEPTANCE))); + assertThat(signature.getStyle(), is(SignatureStyle.ACCEPTANCE)); } @Test @@ -58,10 +58,10 @@ public void buildInitialsForPlaceholder() { Placeholder placeholder = new Placeholder("placeholderId"); Signature signature = initialsFor(placeholder).build(); - assertThat(signature, is(notNullValue())); - assertThat(signature.getRoleId(), is(equalTo(placeholder))); + assertThat(signature, notNullValue()); + assertThat(signature.getRoleId(), is(placeholder)); assertThat(signature.getSignerEmail(), isEmptyOrNullString()); - assertThat(signature.getStyle(), is(equalTo(SignatureStyle.INITIALS))); + assertThat(signature.getStyle(), is(SignatureStyle.INITIALS)); } @Test @@ -69,10 +69,10 @@ public void buildMobileCaptureForPlaceholder() { Placeholder placeholder = new Placeholder("placeholderId"); Signature signature = mobileCaptureFor(placeholder).build(); - assertThat(signature, is(notNullValue())); - assertThat(signature.getRoleId(), is(equalTo(placeholder))); + assertThat(signature, notNullValue()); + assertThat(signature.getRoleId(), is(placeholder)); assertThat(signature.getSignerEmail(), isEmptyOrNullString()); - assertThat(signature.getStyle(), is(equalTo(SignatureStyle.MOBILE_CAPTURE))); + assertThat(signature.getStyle(), is(SignatureStyle.MOBILE_CAPTURE)); } @Test @@ -80,10 +80,10 @@ public void buildCaptureForGroup() { GroupId groupId = new GroupId("myGroupId"); Signature signature = captureFor(groupId).build(); - assertThat(signature, is(notNullValue())); - assertThat(signature.getGroupId(), is(equalTo(groupId))); + assertThat(signature, notNullValue()); + assertThat(signature.getGroupId(), is(groupId)); assertThat(signature.getSignerEmail(), isEmptyOrNullString()); - assertThat(signature.getStyle(), is(equalTo(SignatureStyle.HAND_DRAWN))); + assertThat(signature.getStyle(), is(SignatureStyle.HAND_DRAWN)); } @Test @@ -91,10 +91,10 @@ public void buildSignatureForGroup() { GroupId groupId = new GroupId("myGroupId"); Signature signature = signatureFor(groupId).build(); - assertThat(signature, is(notNullValue())); - assertThat(signature.getGroupId(), is(equalTo(groupId))); + assertThat(signature, notNullValue()); + assertThat(signature.getGroupId(), is(groupId)); assertThat(signature.getSignerEmail(), isEmptyOrNullString()); - assertThat(signature.getStyle(), is(equalTo(SignatureStyle.FULL_NAME))); + assertThat(signature.getStyle(), is(SignatureStyle.FULL_NAME)); } @Test @@ -102,10 +102,10 @@ public void buildAcceptanceForGroup() { GroupId groupId = new GroupId("myGroupId"); Signature signature = SignatureBuilder.acceptanceFor(groupId).build(); - assertThat(signature, is(notNullValue())); - assertThat(signature.getGroupId(), is(equalTo(groupId))); + assertThat(signature, notNullValue()); + assertThat(signature.getGroupId(), is(groupId)); assertThat(signature.getSignerEmail(), isEmptyOrNullString()); - assertThat(signature.getStyle(), is(equalTo(SignatureStyle.ACCEPTANCE))); + assertThat(signature.getStyle(), is(SignatureStyle.ACCEPTANCE)); } @Test @@ -113,10 +113,10 @@ public void buildInitialsForGroup() { GroupId groupId = new GroupId("myGroupId"); Signature signature = initialsFor(groupId).build(); - assertThat(signature, is(notNullValue())); - assertThat(signature.getGroupId(), is(equalTo(groupId))); + assertThat(signature, notNullValue()); + assertThat(signature.getGroupId(), is(groupId)); assertThat(signature.getSignerEmail(), isEmptyOrNullString()); - assertThat(signature.getStyle(), is(equalTo(SignatureStyle.INITIALS))); + assertThat(signature.getStyle(), is(SignatureStyle.INITIALS)); } @Test @@ -124,10 +124,10 @@ public void buildMobileCaptureForGroup() { GroupId groupId = new GroupId("myGroupId"); Signature signature = mobileCaptureFor(groupId).build(); - assertThat(signature, is(notNullValue())); - assertThat(signature.getGroupId(), is(equalTo(groupId))); + assertThat(signature, notNullValue()); + assertThat(signature.getGroupId(), is(groupId)); assertThat(signature.getSignerEmail(), isEmptyOrNullString()); - assertThat(signature.getStyle(), is(equalTo(SignatureStyle.MOBILE_CAPTURE))); + assertThat(signature.getStyle(), is(SignatureStyle.MOBILE_CAPTURE)); } @Test diff --git a/sdk/src/test/java/com/silanis/esl/sdk/builder/SignerInformationForEquifaxCanadaBuilderTest.java b/sdk/src/test/java/com/silanis/esl/sdk/builder/SignerInformationForEquifaxCanadaBuilderTest.java index 8538f56bc..e5a592450 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/builder/SignerInformationForEquifaxCanadaBuilderTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/builder/SignerInformationForEquifaxCanadaBuilderTest.java @@ -9,7 +9,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 9/9/14. @@ -45,17 +44,17 @@ public void buildWithSpecifiedValues() { .withHomePhoneNumber(HOME_PHONE_NUMBER) .build(); - assertThat("build returned a null object", result, is(notNullValue())); - assertThat("First name was not set correctly", result.getFirstName(), is(equalTo(FIRST_NAME))); - assertThat("Last name was not set correctly", result.getLastName(), is(equalTo(LAST_NAME))); - assertThat("Street address was not set correctly", result.getStreetAddress(), is(equalTo(STREET_ADDRESS))); - assertThat("City was not set correctly", result.getCity(), is(equalTo(CITY))); - assertThat("Postal code code was not set correctly", result.getPostalCode(), is(equalTo(POSTAL_CODE))); - assertThat("Province was not set correctly", result.getProvince(), is(equalTo(PROVINCE))); - assertThat("Time at address was not set correctly", result.getTimeAtAddress(), is(equalTo(TIME_AT_ADDRESS))); - assertThat("Date of birth was not set correctly", result.getDateOfBirth(), is(equalTo(DATE_OF_BIRTH))); - assertThat("Driver's license was not set correctly", result.getDriversLicenseNumber(), is(equalTo(DRIVERS_LICENSE_NUMBER))); - assertThat("Social insurance number was not set correctly", result.getSocialInsuranceNumber(), is(equalTo(SOCIAL_INSURANCE_NUMBER))); - assertThat("Home phone number was not set correctly", result.getHomePhoneNumber(), is(equalTo(HOME_PHONE_NUMBER))); + assertThat("build returned a null object", result, notNullValue()); + assertThat("First name was not set correctly", result.getFirstName(), is(FIRST_NAME)); + assertThat("Last name was not set correctly", result.getLastName(), is(LAST_NAME)); + assertThat("Street address was not set correctly", result.getStreetAddress(), is(STREET_ADDRESS)); + assertThat("City was not set correctly", result.getCity(), is(CITY)); + assertThat("Postal code code was not set correctly", result.getPostalCode(), is(POSTAL_CODE)); + assertThat("Province was not set correctly", result.getProvince(), is(PROVINCE)); + assertThat("Time at address was not set correctly", result.getTimeAtAddress(), is(TIME_AT_ADDRESS)); + assertThat("Date of birth was not set correctly", result.getDateOfBirth(), is(DATE_OF_BIRTH)); + assertThat("Driver's license was not set correctly", result.getDriversLicenseNumber(), is(DRIVERS_LICENSE_NUMBER)); + assertThat("Social insurance number was not set correctly", result.getSocialInsuranceNumber(), is(SOCIAL_INSURANCE_NUMBER)); + assertThat("Home phone number was not set correctly", result.getHomePhoneNumber(), is(HOME_PHONE_NUMBER)); } } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/builder/SignerInformationForEquifaxUSABuilderTest.java b/sdk/src/test/java/com/silanis/esl/sdk/builder/SignerInformationForEquifaxUSABuilderTest.java index 02e0aad7b..eddc1c58e 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/builder/SignerInformationForEquifaxUSABuilderTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/builder/SignerInformationForEquifaxUSABuilderTest.java @@ -9,7 +9,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 9/9/14. @@ -45,17 +44,17 @@ public void buildWithSpecifiedValues() { .withTimeAtAddress(TIME_AT_ADDRESS) .build(); - assertThat("build returned a null object", result, is(notNullValue())); - assertThat("First name was not set correctly", result.getFirstName(), is(equalTo(FIRST_NAME))); - assertThat("Last name was not set correctly", result.getLastName(), is(equalTo(LAST_NAME))); - assertThat("Address was not set correctly", result.getStreetAddress(), is(equalTo(ADDRESS))); - assertThat("City was not set correctly", result.getCity(), is(equalTo(CITY))); - assertThat("Zip code was not set correctly", result.getZip(), is(equalTo(ZIP))); - assertThat("State was not set correctly", result.getState(), is(equalTo(STATE))); - assertThat("Social security number was not set correctly", result.getSocialSecurityNumber(), is(equalTo(SOCIAL_SECURITY_NUMBER))); - assertThat("Date of birth was not set correctly", result.getDateOfBirth(), is(equalTo(DATE_OF_BIRTH))); - assertThat("Home phone was not set correctly", result.getHomePhoneNumber(), is(equalTo(HOME_PHONE))); - assertThat("Driver's license number was not set correctly", result.getDriversLicenseNumber(), is(equalTo(DRIVERS_LICENSE_NUMBER))); - assertThat("Time at address was not set correctly", result.getTimeAtAddress(), is(equalTo(TIME_AT_ADDRESS))); + assertThat("build returned a null object", result, notNullValue()); + assertThat("First name was not set correctly", result.getFirstName(), is(FIRST_NAME)); + assertThat("Last name was not set correctly", result.getLastName(), is(LAST_NAME)); + assertThat("Address was not set correctly", result.getStreetAddress(), is(ADDRESS)); + assertThat("City was not set correctly", result.getCity(), is(CITY)); + assertThat("Zip code was not set correctly", result.getZip(), is(ZIP)); + assertThat("State was not set correctly", result.getState(), is(STATE)); + assertThat("Social security number was not set correctly", result.getSocialSecurityNumber(), is(SOCIAL_SECURITY_NUMBER)); + assertThat("Date of birth was not set correctly", result.getDateOfBirth(), is(DATE_OF_BIRTH)); + assertThat("Home phone was not set correctly", result.getHomePhoneNumber(), is(HOME_PHONE)); + assertThat("Driver's license number was not set correctly", result.getDriversLicenseNumber(), is(DRIVERS_LICENSE_NUMBER)); + assertThat("Time at address was not set correctly", result.getTimeAtAddress(), is(TIME_AT_ADDRESS)); } } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/builder/internal/FileDocumentSourceTest.java b/sdk/src/test/java/com/silanis/esl/sdk/builder/internal/FileDocumentSourceTest.java index c01a99729..9690f767e 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/builder/internal/FileDocumentSourceTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/builder/internal/FileDocumentSourceTest.java @@ -6,7 +6,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; public class FileDocumentSourceTest { @@ -17,7 +16,7 @@ public void readsFileContent() { FileDocumentSource source = new FileDocumentSource(file); byte[] content = source.content(); - assertThat(content, is(notNullValue())); + assertThat(content, notNullValue()); assertThat(content.length, greaterThan(0)); } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/builder/internal/StreamDocumentSourceTest.java b/sdk/src/test/java/com/silanis/esl/sdk/builder/internal/StreamDocumentSourceTest.java deleted file mode 100644 index 7da385317..000000000 --- a/sdk/src/test/java/com/silanis/esl/sdk/builder/internal/StreamDocumentSourceTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.silanis.esl.sdk.builder.internal; - -import org.junit.Test; - -import java.io.InputStream; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; - -public class StreamDocumentSourceTest { - -// @Test -// public void readsStreamContentToByteArray() { -// InputStream input = getClass().getResourceAsStream("/document.pdf"); -// StreamDocumentSource source = new StreamDocumentSource(input); -// byte[] content = source.content(); -// -// assertThat(content, is(notNullValue())); -// assertThat(content.length, is(greaterThan(0))); -// } -} \ No newline at end of file diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AttachmentRequirementConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AttachmentRequirementConverterTest.java index 2b60f8178..c2eb0645b 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AttachmentRequirementConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AttachmentRequirementConverterTest.java @@ -2,14 +2,12 @@ import com.silanis.esl.sdk.AttachmentRequirement; import com.silanis.esl.sdk.builder.AttachmentRequirementBuilder; -import org.hamcrest.Matchers; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by lena on 2014-05-09. @@ -28,7 +26,7 @@ public class AttachmentRequirementConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkAttachmentRequirement1 = null; converter = new AttachmentRequirementConverter(sdkAttachmentRequirement1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIAttachmentRequirement(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIAttachmentRequirement(), nullValue()); } @Override @@ -36,7 +34,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiAttachmentRequirement1 = null; converter = new AttachmentRequirementConverter(apiAttachmentRequirement1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKAttachmentRequirement(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKAttachmentRequirement(), nullValue()); } @Override @@ -44,7 +42,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkAttachmentRequirement1 = null; converter = new AttachmentRequirementConverter(sdkAttachmentRequirement1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKAttachmentRequirement(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKAttachmentRequirement(), nullValue()); } @Override @@ -52,7 +50,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiAttachmentRequirement1 = null; converter = new AttachmentRequirementConverter(apiAttachmentRequirement1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIAttachmentRequirement(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIAttachmentRequirement(), nullValue()); } @Override @@ -61,8 +59,8 @@ public void convertSDKToSDK() { sdkAttachmentRequirement1 = createTypicalSDKAttachmentRequirement(); sdkAttachmentRequirement2 = new AttachmentRequirementConverter(sdkAttachmentRequirement1).toSDKAttachmentRequirement(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkAttachmentRequirement2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkAttachmentRequirement2, is(equalTo(sdkAttachmentRequirement1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkAttachmentRequirement2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkAttachmentRequirement2, is(sdkAttachmentRequirement1)); } @Override @@ -71,8 +69,8 @@ public void convertAPIToAPI() { apiAttachmentRequirement1 = createTypicalAPIAttachmentRequirement(); apiAttachmentRequirement2 = new AttachmentRequirementConverter(apiAttachmentRequirement1).toAPIAttachmentRequirement(); - assertThat("Converter returned a null api object for a non null api object", apiAttachmentRequirement2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiAttachmentRequirement2, is(equalTo(apiAttachmentRequirement1))); + assertThat("Converter returned a null api object for a non null api object", apiAttachmentRequirement2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiAttachmentRequirement2, is(apiAttachmentRequirement1)); } @Override @@ -81,12 +79,12 @@ public void convertAPIToSDK() { apiAttachmentRequirement1 = createTypicalAPIAttachmentRequirement(); sdkAttachmentRequirement1 = new AttachmentRequirementConverter(apiAttachmentRequirement1).toSDKAttachmentRequirement(); - assertThat("Attachment's name was not set correctly", sdkAttachmentRequirement1.getName(), is(equalTo(apiAttachmentRequirement1.getName()))); - assertThat("Attachment's description was not set correctly", sdkAttachmentRequirement1.getDescription(), is(equalTo(apiAttachmentRequirement1.getDescription()))); - assertThat("Attachment's ID was not set correctly", sdkAttachmentRequirement1.getId(), is(equalTo(apiAttachmentRequirement1.getId()))); + assertThat("Attachment's name was not set correctly", sdkAttachmentRequirement1.getName(), is(apiAttachmentRequirement1.getName())); + assertThat("Attachment's description was not set correctly", sdkAttachmentRequirement1.getDescription(), is(apiAttachmentRequirement1.getDescription())); + assertThat("Attachment's ID was not set correctly", sdkAttachmentRequirement1.getId(), is(apiAttachmentRequirement1.getId())); assertThat("Attachment's required property was not set correctly", sdkAttachmentRequirement1.isRequired(), is(apiAttachmentRequirement1.getRequired())); - assertThat("Attachment's status was not set correctly", sdkAttachmentRequirement1.getStatus().toString(), is(equalTo(apiAttachmentRequirement1.getStatus().toString()))); - assertThat("Attachment's comments was not set correctly", sdkAttachmentRequirement1.getSenderComment(), is(equalTo(apiAttachmentRequirement1.getComment()))); + assertThat("Attachment's status was not set correctly", sdkAttachmentRequirement1.getStatus().toString(), is(apiAttachmentRequirement1.getStatus())); + assertThat("Attachment's comments was not set correctly", sdkAttachmentRequirement1.getSenderComment(), is(apiAttachmentRequirement1.getComment())); } @Override @@ -95,12 +93,12 @@ public void convertSDKToAPI() { sdkAttachmentRequirement1 = createTypicalSDKAttachmentRequirement(); apiAttachmentRequirement1 = new AttachmentRequirementConverter(sdkAttachmentRequirement1).toAPIAttachmentRequirement(); - assertThat("Attachment's name was not set correctly", apiAttachmentRequirement1.getName(), is(equalTo(sdkAttachmentRequirement1.getName()))); - assertThat("Attachment's description was not set correctly", apiAttachmentRequirement1.getDescription(), is(equalTo(sdkAttachmentRequirement1.getDescription()))); + assertThat("Attachment's name was not set correctly", apiAttachmentRequirement1.getName(), is(sdkAttachmentRequirement1.getName())); + assertThat("Attachment's description was not set correctly", apiAttachmentRequirement1.getDescription(), is(sdkAttachmentRequirement1.getDescription())); assertThat("Attachment's required property was not set correctly", apiAttachmentRequirement1.getRequired(), is(sdkAttachmentRequirement1.isRequired())); - assertThat("Attachment's ID was not set correctly", apiAttachmentRequirement1.getId(), is(equalTo(sdkAttachmentRequirement1.getId()))); - assertThat("Attachment's status was not set correctly", apiAttachmentRequirement1.getStatus().toString(), is(equalTo(sdkAttachmentRequirement1.getStatus().toString()))); - assertThat("Attachment's comments was not set correctly", apiAttachmentRequirement1.getComment(), is(equalTo(sdkAttachmentRequirement1.getSenderComment()))); + assertThat("Attachment's ID was not set correctly", apiAttachmentRequirement1.getId(), is(sdkAttachmentRequirement1.getId())); + assertThat("Attachment's status was not set correctly", apiAttachmentRequirement1.getStatus(), is(sdkAttachmentRequirement1.getStatus().toString())); + assertThat("Attachment's comments was not set correctly", apiAttachmentRequirement1.getComment(), is(sdkAttachmentRequirement1.getSenderComment())); } /** diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AuthenticationConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AuthenticationConverterTest.java index ad38fe98e..183d2ff7a 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AuthenticationConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AuthenticationConverterTest.java @@ -78,7 +78,7 @@ public void convertSDKToAPI() { com.silanis.esl.api.model.Auth result = converter.toAPIAuthentication(); assertThat( "Converter returned a null api object for a non null sdk object", result, is( notNullValue() ) ); assertThat( "scheme was not set correctly", result.getScheme(), is( equalTo(authentication.getMethod().name()))); - assertThat("Challenge question was not set correctly", result.getChallenges().get(0).getQuestion(), is(equalTo(authentication.getChallenges().get(0).getQuestion()))); + assertThat("Challenge question was not set correctly", result.getChallenges().get(0).getQuestion(), is(authentication.getChallenges().get(0).getQuestion())); } private Authentication createTypicalSDKAuthentication() { diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AuthenticationMethodConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AuthenticationMethodConverterTest.java index 5e33f4a9e..e5ab94c4e 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AuthenticationMethodConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/AuthenticationMethodConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 12/15/14. @@ -22,28 +21,28 @@ public class AuthenticationMethodConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkAuthenticationMethod = null; converter = new AuthenticationMethodConverter(sdkAuthenticationMethod); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIAuthMethod(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIAuthMethod(), nullValue()); } @Test public void convertNullAPIToSDK() { apiAuthenticationMethod = null; converter = new AuthenticationMethodConverter(apiAuthenticationMethod); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKAuthMethod(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKAuthMethod(), nullValue()); } @Test public void convertNullSDKToSDK() { sdkAuthenticationMethod = null; converter = new AuthenticationMethodConverter(sdkAuthenticationMethod); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKAuthMethod(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKAuthMethod(), nullValue()); } @Test public void convertNullAPIToAPI() { apiAuthenticationMethod = null; converter = new AuthenticationMethodConverter(apiAuthenticationMethod); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIAuthMethod(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIAuthMethod(), nullValue()); } @Test @@ -52,8 +51,8 @@ public void convertSDKToSDK() { converter = new AuthenticationMethodConverter(sdkAuthenticationMethod); AuthenticationMethod result = converter.toSDKAuthMethod(); - assertThat("Converter returned a null sdk object for a non null sdk object", result, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", result, is(equalTo(sdkAuthenticationMethod))); + assertThat("Converter returned a null sdk object for a non null sdk object", result, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", result, is(sdkAuthenticationMethod)); } @Test @@ -62,8 +61,8 @@ public void convertAPIToAPI() { converter = new AuthenticationMethodConverter(apiAuthenticationMethod); String result = converter.toAPIAuthMethod(); - assertThat("Converter returned a null api object for a non null api object", result, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", result, is(equalTo(apiAuthenticationMethod))); + assertThat("Converter returned a null api object for a non null api object", result, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", result, is(apiAuthenticationMethod)); } @Test diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/BasePackageTypeConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/BasePackageTypeConverterTest.java index e253e6886..a45f80727 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/BasePackageTypeConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/BasePackageTypeConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 12/16/14. @@ -25,7 +24,7 @@ public class BasePackageTypeConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkBasePackageType1 = null; converter = new BasePackageTypeConverter(sdkBasePackageType1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIBasePackageType(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIBasePackageType(), nullValue()); } @Override @@ -33,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiBasePackageType1 = null; converter = new BasePackageTypeConverter(apiBasePackageType1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKBasePackageType(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKBasePackageType(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkBasePackageType1 = null; converter = new BasePackageTypeConverter(sdkBasePackageType1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKBasePackageType(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKBasePackageType(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiBasePackageType1 = null; converter = new BasePackageTypeConverter(apiBasePackageType1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIBasePackageType(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIBasePackageType(), nullValue()); } @Override @@ -58,8 +57,8 @@ public void convertSDKToSDK() { sdkBasePackageType1 = BasePackageType.PACKAGE; sdkBasePackageType2 = new BasePackageTypeConverter(sdkBasePackageType1).toSDKBasePackageType(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkBasePackageType2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkBasePackageType2, is(equalTo(sdkBasePackageType1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkBasePackageType2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkBasePackageType2, is(sdkBasePackageType1)); } @Override @@ -68,8 +67,8 @@ public void convertAPIToAPI() { apiBasePackageType1 = "PACKAGE"; apiBasePackageType2 = new BasePackageTypeConverter(apiBasePackageType1).toAPIBasePackageType(); - assertThat("Converter returned a null api object for a non null api object", apiBasePackageType2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiBasePackageType2, is(equalTo(apiBasePackageType1))); + assertThat("Converter returned a null api object for a non null api object", apiBasePackageType2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiBasePackageType2, is(apiBasePackageType1)); } @Override diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CeremonyLayoutSettingsConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CeremonyLayoutSettingsConverterTest.java index df0b11f93..9b991de71 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CeremonyLayoutSettingsConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CeremonyLayoutSettingsConverterTest.java @@ -33,21 +33,21 @@ public class CeremonyLayoutSettingsConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkCeremonyLayoutSettings1 = null; converter = new CeremonyLayoutSettingsConverter(sdkCeremonyLayoutSettings1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPILayoutOptions(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPILayoutOptions(), nullValue()); } @Override public void convertNullAPIToSDK() { apiLayoutOptions1 = null; converter = new CeremonyLayoutSettingsConverter(apiLayoutOptions1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKCeremonyLayoutSettings(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKCeremonyLayoutSettings(), nullValue()); } @Override public void convertNullSDKToSDK() { sdkCeremonyLayoutSettings1 = null; converter = new CeremonyLayoutSettingsConverter(sdkCeremonyLayoutSettings1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKCeremonyLayoutSettings(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKCeremonyLayoutSettings(), nullValue()); } @Override @@ -55,14 +55,14 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiLayoutOptions1 = null; converter = new CeremonyLayoutSettingsConverter(apiLayoutOptions1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPILayoutOptions(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPILayoutOptions(), nullValue()); } @Override public void convertSDKToSDK() { sdkCeremonyLayoutSettings1 = createTypicalSDKCeremonyLayoutSettings(); sdkCeremonyLayoutSettings2 = new CeremonyLayoutSettingsConverter(sdkCeremonyLayoutSettings1).toSDKCeremonyLayoutSettings(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkCeremonyLayoutSettings2, is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkCeremonyLayoutSettings2, notNullValue()); assertThat("Converter didn't return the same non-null sdk object it was given", sdkCeremonyLayoutSettings2, is(IsEqual.equalTo(sdkCeremonyLayoutSettings1))); } @@ -71,7 +71,7 @@ public void convertSDKToSDK() { public void convertAPIToAPI() { apiLayoutOptions1 = createTypicalAPICeremonyLayoutSettings(); apiLayoutOptions2 = new CeremonyLayoutSettingsConverter(apiLayoutOptions1).toAPILayoutOptions(); - assertThat("Converter returned a null api object for a non null api object", apiLayoutOptions2, is(notNullValue())); + assertThat("Converter returned a null api object for a non null api object", apiLayoutOptions2, notNullValue()); assertThat("Converter didn't return the same non-null api object it was given", apiLayoutOptions2, is(IsEqual.equalTo(apiLayoutOptions1))); } @@ -80,9 +80,9 @@ public void convertAPIToSDK() { apiLayoutOptions1 = createTypicalAPICeremonyLayoutSettings(); sdkCeremonyLayoutSettings1 = new CeremonyLayoutSettingsConverter(apiLayoutOptions1).toSDKCeremonyLayoutSettings(); - assertThat("Converter didn't return a null sdk object for a non null api object", sdkCeremonyLayoutSettings1, is(notNullValue())); - assertThat("Logo image link is not null", sdkCeremonyLayoutSettings1.getLogoImageLink(), is(nullValue())); - assertThat("Logo image source is not null", sdkCeremonyLayoutSettings1.getLogoImageSource(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a non null api object", sdkCeremonyLayoutSettings1, notNullValue()); + assertThat("Logo image link is not null", sdkCeremonyLayoutSettings1.getLogoImageLink(), nullValue()); + assertThat("Logo image source is not null", sdkCeremonyLayoutSettings1.getLogoImageSource(), nullValue()); assertThat("IFrame was not set correctly", sdkCeremonyLayoutSettings1.getiFrame(), is(apiLayoutOptions1.getIframe())); assertThat("ShowTitle was not set correctly", sdkCeremonyLayoutSettings1.getShowTitle(), is(apiLayoutOptions1.getHeader().getTitleBar().getTitle())); assertThat("SessionBar was not set correctly", sdkCeremonyLayoutSettings1.getSessionBar(), is(apiLayoutOptions1.getHeader().getSessionBar())); @@ -98,9 +98,9 @@ public void convertAPIToSDK() { public void convertSDKToAPI() { sdkCeremonyLayoutSettings1 = createTypicalSDKCeremonyLayoutSettings(); apiLayoutOptions2 = new CeremonyLayoutSettingsConverter(sdkCeremonyLayoutSettings1).toAPILayoutOptions(); - assertThat("", apiLayoutOptions2.getBrandingBar().getLogo().getLink(), is(equalTo(sdkCeremonyLayoutSettings1.getLogoImageLink()))); + assertThat("", apiLayoutOptions2.getBrandingBar().getLogo().getLink(), is(sdkCeremonyLayoutSettings1.getLogoImageLink())); - assertThat("Converter didn't return a null api object for a non null sdk object", apiLayoutOptions2, is(notNullValue())); + assertThat("Converter didn't return a null api object for a non null sdk object", apiLayoutOptions2, notNullValue()); assertThat("Logo image link was not set correctly", apiLayoutOptions2.getBrandingBar().getLogo().getLink(), is(sdkCeremonyLayoutSettings1.getLogoImageLink())); assertThat("Logo image source is not set correctly", apiLayoutOptions2.getBrandingBar().getLogo().getSrc(), is(sdkCeremonyLayoutSettings1.getLogoImageSource())); assertThat("IFrame was not set correctly", apiLayoutOptions1.getIframe(), is(sdkCeremonyLayoutSettings1.getiFrame())); diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ChallengeConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ChallengeConverterTest.java index 06b077513..03802b10a 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ChallengeConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ChallengeConverterTest.java @@ -26,7 +26,7 @@ public class ChallengeConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkChallenge = null; converter = new ChallengeConverter(sdkChallenge); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIChallenge(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIChallenge(), nullValue()); } @Override @@ -34,7 +34,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiChallenge = null; converter = new ChallengeConverter(apiChallenge); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKChallenge(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKChallenge(), nullValue()); } @Override @@ -42,7 +42,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkChallenge = null; converter = new ChallengeConverter(sdkChallenge); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKChallenge(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKChallenge(), nullValue()); } @Override @@ -50,7 +50,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiChallenge = null; converter = new ChallengeConverter(apiChallenge); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIChallenge(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIChallenge(), nullValue()); } @Override @@ -59,8 +59,8 @@ public void convertSDKToSDK() { sdkChallenge = createTypicalSDKChallenge(); sdkChallenge = new ChallengeConverter(sdkChallenge).toSDKChallenge(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkChallenge, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkChallenge, is(equalTo(sdkChallenge))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkChallenge, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkChallenge, is(sdkChallenge)); } @Override @@ -69,8 +69,8 @@ public void convertAPIToAPI() { apiChallenge = createTypicalAPIAuthChallenge(); apiChallenge = new ChallengeConverter(apiChallenge).toAPIChallenge(); - assertThat("Converter returned a null api object for a non null api object", apiChallenge, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiChallenge, is(equalTo(apiChallenge))); + assertThat("Converter returned a null api object for a non null api object", apiChallenge, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiChallenge, is(apiChallenge)); } @Override @@ -79,7 +79,7 @@ public void convertAPIToSDK() { apiChallenge = createTypicalAPIAuthChallenge(); sdkChallenge = new ChallengeConverter(apiChallenge).toSDKChallenge(); - assertThat("Converter returned a null sdk object for a non null api object", sdkChallenge, is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", sdkChallenge, notNullValue()); assertThat("Question was not correctly set", sdkChallenge.getQuestion(), is(apiChallenge.getQuestion())); assertThat("Answer was not correctly set", sdkChallenge.getAnswer(), is(apiChallenge.getAnswer())); assertThat("MaskOption was not correctly set", sdkChallenge.getMaskOption(), is(Challenge.MaskOptions.None)); @@ -91,7 +91,7 @@ public void convertSDKToAPI() { sdkChallenge = createTypicalSDKChallenge(); apiChallenge = new ChallengeConverter(sdkChallenge).toAPIChallenge(); - assertThat("Converter returned a null api object for a non null sdk object", apiChallenge, is(notNullValue())); + assertThat("Converter returned a null api object for a non null sdk object", apiChallenge, notNullValue()); assertThat("Question was not correctly set", apiChallenge.getQuestion(), is(sdkChallenge.getQuestion())); assertThat("Answer was not correctly set", apiChallenge.getAnswer(), is(sdkChallenge.getAnswer())); assertThat("MaskOption was not correctly set", apiChallenge.getMaskInput(), is(false)); diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CompletionReportConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CompletionReportConverterTest.java index bf8be133b..ab310549e 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CompletionReportConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CompletionReportConverterTest.java @@ -30,7 +30,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiCompletionReport1 = null; converter = new CompletionReportConverter(apiCompletionReport1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKCompletionReport(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKCompletionReport(), nullValue()); } @Override @@ -74,7 +74,7 @@ public void convertAPIToSDK() { com.silanis.esl.sdk.PackageCompletionReport sdkPackageCompletionReport = sdkCompletionReport1.getSenders().get(0).getPackages().get(0); assertThat("Package completion report has the wrong id.", sdkPackageCompletionReport.getId(), is(apiPackageCompletionReport.getId())); assertThat("Package completion report has the wrong name.", sdkPackageCompletionReport.getName(), is(apiPackageCompletionReport.getName())); - assertThat("Package completion report has the wrong package status.", sdkPackageCompletionReport.getPackageStatus().toString(), is(apiPackageCompletionReport.getStatus().toString())); + assertThat("Package completion report has the wrong package status.", sdkPackageCompletionReport.getPackageStatus().toString(), is(apiPackageCompletionReport.getStatus())); assertThat("Package completion report has the wrong created date.", sdkPackageCompletionReport.getCreated(), is(apiPackageCompletionReport.getCreated())); assertThat("Package completion report should have 1 document completion report.", sdkPackageCompletionReport.getDocuments().size(), is(1)); assertThat("Package completion report should have 1 signer completion report.", sdkPackageCompletionReport.getSigners().size(), is(1)); diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ConditionalFieldConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ConditionalFieldConverterTest.java index fec3541c1..a46bb8801 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ConditionalFieldConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ConditionalFieldConverterTest.java @@ -27,7 +27,7 @@ public class ConditionalFieldConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkField1 = null; converter = new ConditionalFieldConverter(sdkField1); - assertThat( "Converter didn't return a null api object for a null sdk object", converter.toAPIConditionalField(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIConditionalField(), is(nullValue())); } @Override @@ -35,7 +35,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiField1 = null; converter = new ConditionalFieldConverter(apiField1); - assertThat( "Converter didn't return a null sdk object for a null api object", converter.toSDKConditionalField(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKConditionalField(), is(nullValue())); } @Override @@ -43,7 +43,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkField1 = null; converter = new ConditionalFieldConverter(sdkField1); - assertThat( "Converter didn't return a null sdk object for a null sdk object", converter.toSDKConditionalField(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKConditionalField(), is(nullValue())); } @Override @@ -51,7 +51,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiField1 = null; converter = new ConditionalFieldConverter(apiField1); - assertThat( "Converter didn't return a null api object for a null api object", converter.toAPIConditionalField(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIConditionalField(), is(nullValue())); } @Override @@ -60,8 +60,8 @@ public void convertSDKToSDK() { sdkField1 = createTypicalSDKConditionalField(); sdkField2 = new ConditionalFieldConverter(sdkField1).toSDKConditionalField(); - assertThat( "Converter returned a null sdk object for a non null sdk object", sdkField2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null sdk object it was given", sdkField2, is( equalTo( sdkField1 ) ) ); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkField2, is(notNullValue())); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkField2, is(equalTo(sdkField1))); } @Override @@ -71,8 +71,8 @@ public void convertAPIToAPI() { apiField1 = createTypicalAPIConditionalField(); apiField2 = new ConditionalFieldConverter(apiField1).toAPIConditionalField(); - assertThat( "Converter returned a null api object for a non null api object", apiField2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null api object it was given", apiField2, is( equalTo( apiField1 ) ) ); + assertThat("Converter returned a null api object for a non null api object", apiField2, is(notNullValue())); + assertThat("Converter didn't return the same non-null api object it was given", apiField2, is(equalTo(apiField1))); } @Override @@ -81,17 +81,17 @@ public void convertAPIToSDK() { apiField1 = createTypicalAPIConditionalField(); sdkField1 = new ConditionalFieldConverter(apiField1).toSDKConditionalField(); - assertThat("Converter returned a null api object for a non null sdk object", apiField1, is( notNullValue() ) ); - assertThat("Left coordinate was not correctly set", apiField1.getLeft(), is( equalTo(sdkField1.getX()) ) ); - assertThat("Top coordinate was not correctly set", apiField1.getTop(), is(equalTo(sdkField1.getY()))); - assertThat("Width was not correctly set", apiField1.getWidth(), is(equalTo(sdkField1.getWidth()))); - assertThat("Height was not correctly set",apiField1.getHeight(), is(equalTo(sdkField1.getHeight()))); - assertThat("Page was not correctly set",apiField1.getPage(), is(equalTo(sdkField1.getPage()))); - assertThat("Extract was not correctly set",apiField1.getExtract(), is(equalTo(sdkField1.isExtraction()))); - assertThat("Value was not correctly set",apiField1.getValue(), is(equalTo(sdkField1.getValue()))); - assertThat("ID was not correctly set", apiField1.getId(), is(equalTo(sdkField1.getId().toString()))); - assertThat("Name was not correctly set", apiField1.getName(), is(equalTo(sdkField1.getName()))); - assertThat("Conditions was not correctly set", apiField1.getConditions().size(), is(equalTo(sdkField1.getConditions().size()))); + assertThat("Converter returned a null api object for a non null sdk object", apiField1, is(notNullValue())); + assertThat("Left coordinate was not correctly set", apiField1.getLeft(), is(equalTo(sdkField1.getX()))); + assertThat("Top coordinate was not correctly set", apiField1.getTop(), is(sdkField1.getY())); + assertThat("Width was not correctly set", apiField1.getWidth(), is(sdkField1.getWidth())); + assertThat("Height was not correctly set", apiField1.getHeight(), is(sdkField1.getHeight())); + assertThat("Page was not correctly set", apiField1.getPage(), is(sdkField1.getPage())); + assertThat("Extract was not correctly set", apiField1.getExtract(), is(sdkField1.isExtraction())); + assertThat("Value was not correctly set", apiField1.getValue(), is(sdkField1.getValue())); + assertThat("ID was not correctly set", apiField1.getId(), is(sdkField1.getId().toString())); + assertThat("Name was not correctly set", apiField1.getName(), is(sdkField1.getName())); + assertThat("Conditions was not correctly set", apiField1.getConditions().size(), is(sdkField1.getConditions().size())); } @Override @@ -101,17 +101,18 @@ public void convertSDKToAPI() { sdkField1 = createTypicalSDKConditionalField(); apiField1 = new ConditionalFieldConverter(sdkField1).toAPIConditionalField(); - assertThat("Converter returned a null api object for a non null sdk object", apiField1, is( notNullValue() ) ); - assertThat("Left coordinate was not correctly set", apiField1.getLeft(), is( equalTo(sdkField1.getX()) ) ); - assertThat("Top coordinate was not correctly set", apiField1.getTop(), is(equalTo(sdkField1.getY()))); - assertThat("Width was not correctly set", apiField1.getWidth(), is(equalTo(sdkField1.getWidth()))); - assertThat("Height was not correctly set",apiField1.getHeight(), is(equalTo(sdkField1.getHeight()))); - assertThat("Page was not correctly set",apiField1.getPage(), is(equalTo(sdkField1.getPage()))); - assertThat("Extract was not correctly set",apiField1.getExtract(), is(equalTo(sdkField1.isExtraction()))); - assertThat("Value was not correctly set",apiField1.getValue(), is(equalTo(sdkField1.getValue()))); - assertThat("ID was not correctly set", apiField1.getId(), is(equalTo(sdkField1.getId().toString()))); - assertThat("Name was not correctly set", apiField1.getName(), is(equalTo(sdkField1.getName()))); - assertThat("Conditions was not correctly set", apiField1.getConditions().size(), is(equalTo(sdkField1.getConditions().size()))); + assertThat("Converter returned a null api object for a non null sdk object", apiField1, is(notNullValue())); + assertThat("Left coordinate was not correctly set", apiField1.getLeft(), is(equalTo(sdkField1.getX()))); + assertThat("Top coordinate was not correctly set", apiField1.getTop(), is(sdkField1.getY())); + assertThat("Width was not correctly set", apiField1.getWidth(), is(sdkField1.getWidth())); + assertThat("Height was not correctly set", apiField1.getHeight(), is(sdkField1.getHeight())); + assertThat("Page was not correctly set", apiField1.getPage(), is(sdkField1.getPage())); + assertThat("Extract was not correctly set", apiField1.getExtract(), is(sdkField1.isExtraction())); + assertThat("Value was not correctly set", apiField1.getValue(), is(sdkField1.getValue())); + assertThat("ID was not correctly set", apiField1.getId(), is(sdkField1.getId().toString())); + assertThat("Name was not correctly set", apiField1.getName(), is(sdkField1.getName())); + assertThat("Conditions was not correctly set", apiField1.getConditions().size(), is(sdkField1.getConditions().size())); + assertThat("Conditions was not correctly set", apiField1.getConditions().size(), is(sdkField1.getConditions().size())); } /** diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CustomFieldConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CustomFieldConverterTest.java index 989e5d6bf..9d40fa1f0 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CustomFieldConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/CustomFieldConverterTest.java @@ -30,7 +30,7 @@ public class CustomFieldConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkCustomField1 = null; converter = new CustomFieldConverter(sdkCustomField1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPICustomField(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPICustomField(), nullValue()); } @Override @@ -38,7 +38,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiCustomField1 = null; converter = new CustomFieldConverter(apiCustomField1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKCustomField(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKCustomField(), nullValue()); } @Override @@ -46,7 +46,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkCustomField1 = null; converter = new CustomFieldConverter(sdkCustomField1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKCustomField(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKCustomField(), nullValue()); } @Override @@ -54,7 +54,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiCustomField1 = null; converter = new CustomFieldConverter(apiCustomField1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPICustomField(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPICustomField(), nullValue()); } @Override @@ -63,8 +63,8 @@ public void convertSDKToSDK() { sdkCustomField1 = createTypicalSDKCustomField(); sdkCustomField2 = new CustomFieldConverter(sdkCustomField1).toSDKCustomField(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkCustomField2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkCustomField2, is(equalTo(sdkCustomField1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkCustomField2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkCustomField2, is(sdkCustomField1)); } @Override @@ -74,8 +74,8 @@ public void convertAPIToAPI() { apiCustomField1 = createTypicalAPICustomField(); apiCustomField2 = new CustomFieldConverter(apiCustomField1).toAPICustomField(); - assertThat("Converter returned a null api object for a non null api object", apiCustomField2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiCustomField2, is(equalTo(apiCustomField1))); + assertThat("Converter returned a null api object for a non null api object", apiCustomField2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiCustomField2, is(apiCustomField1)); } @Override @@ -84,10 +84,10 @@ public void convertAPIToSDK() { apiCustomField1 = createTypicalAPICustomField(); sdkCustomField1 = new CustomFieldConverter(apiCustomField1).toSDKCustomField(); - assertThat("Converter returned a null api object for a non null sdk object", sdkCustomField1, is(notNullValue())); - assertThat("ID was not correctly set", apiCustomField1.getId(), is(equalTo(sdkCustomField1.getId()))); - assertThat("Value was not correctly set", apiCustomField1.getValue(), is(equalTo(sdkCustomField1.getValue()))); - assertThat("Required was not correctly set", apiCustomField1.getRequired(), is(equalTo(sdkCustomField1.getRequired()))); + assertThat("Converter returned a null api object for a non null sdk object", sdkCustomField1, notNullValue()); + assertThat("ID was not correctly set", apiCustomField1.getId(), is(sdkCustomField1.getId())); + assertThat("Value was not correctly set", apiCustomField1.getValue(), is(sdkCustomField1.getValue())); + assertThat("Required was not correctly set", apiCustomField1.getRequired(), is(sdkCustomField1.getRequired())); } @Override @@ -97,11 +97,11 @@ public void convertSDKToAPI() { sdkCustomField1 = createTypicalSDKCustomField(); apiCustomField1 = new CustomFieldConverter(sdkCustomField1).toAPICustomField(); - assertThat("Converter returned a null api object for a non null sdk object", apiCustomField1, is(notNullValue())); - assertThat("Converter returned a null api object for a non null sdk object", apiCustomField1, is(notNullValue())); - assertThat("ID was not correctly set", apiCustomField1.getId(), is(equalTo(sdkCustomField1.getId()))); - assertThat("Value was not correctly set", apiCustomField1.getValue(), is(equalTo(sdkCustomField1.getValue()))); - assertThat("Required was not correctly set", apiCustomField1.getRequired(), is(equalTo(sdkCustomField1.getRequired()))); + assertThat("Converter returned a null api object for a non null sdk object", apiCustomField1, notNullValue()); + assertThat("Converter returned a null api object for a non null sdk object", apiCustomField1, notNullValue()); + assertThat("ID was not correctly set", apiCustomField1.getId(), is(sdkCustomField1.getId())); + assertThat("Value was not correctly set", apiCustomField1.getValue(), is(sdkCustomField1.getValue())); + assertThat("Required was not correctly set", apiCustomField1.getRequired(), is(sdkCustomField1.getRequired())); } /** diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationEventReportConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationEventReportConverterTest.java index 5132cefd3..07c251442 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationEventReportConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationEventReportConverterTest.java @@ -24,7 +24,7 @@ public class DelegationEventReportConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkDelegationEventReport = null; converter = new DelegationEventReportConverter(sdkDelegationEventReport); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIDelegationEventReport(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIDelegationEventReport(), nullValue()); } @Override @@ -32,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiDelegationEventReport = null; converter = new DelegationEventReportConverter(apiDelegationEventReport); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKDelegationEventReport(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKDelegationEventReport(), nullValue()); } @Override @@ -40,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkDelegationEventReport = null; converter = new DelegationEventReportConverter(sdkDelegationEventReport); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKDelegationEventReport(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKDelegationEventReport(), nullValue()); } @Override @@ -48,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiDelegationEventReport = null; converter = new DelegationEventReportConverter(apiDelegationEventReport); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIDelegationEventReport(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIDelegationEventReport(), nullValue()); } @Override @@ -57,8 +57,8 @@ public void convertSDKToSDK() { sdkDelegationEventReport = createTypicalSDKDelegationEventReport(); sdkDelegationEventReport = new DelegationEventReportConverter(sdkDelegationEventReport).toSDKDelegationEventReport(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkDelegationEventReport, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkDelegationEventReport, is(equalTo(sdkDelegationEventReport))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkDelegationEventReport, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkDelegationEventReport, is(sdkDelegationEventReport)); } @Override @@ -67,8 +67,8 @@ public void convertAPIToAPI() { apiDelegationEventReport = createTypicalAPIDelegationEventReport(); apiDelegationEventReport = new DelegationEventReportConverter(apiDelegationEventReport).toAPIDelegationEventReport(); - assertThat("Converter returned a null api object for a non null api object", apiDelegationEventReport, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiDelegationEventReport, is(equalTo(apiDelegationEventReport))); + assertThat("Converter returned a null api object for a non null api object", apiDelegationEventReport, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiDelegationEventReport, is(apiDelegationEventReport)); } @Override @@ -77,7 +77,7 @@ public void convertAPIToSDK() { apiDelegationEventReport = createTypicalAPIDelegationEventReport(); sdkDelegationEventReport = new DelegationEventReportConverter(apiDelegationEventReport).toSDKDelegationEventReport(); - assertThat("Converter returned a null sdk object for a non null api object", sdkDelegationEventReport, is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", sdkDelegationEventReport, notNullValue()); assertThat("EventDate was not correctly set", sdkDelegationEventReport.getEventDate(), is(apiDelegationEventReport.getEventDate())); assertThat("EventDescription was not correctly set", sdkDelegationEventReport.getEventDescription(), is(apiDelegationEventReport.getEventDescription())); assertThat("EventType was not correctly set", sdkDelegationEventReport.getEventType(), is(apiDelegationEventReport.getEventType())); @@ -90,7 +90,7 @@ public void convertSDKToAPI() { sdkDelegationEventReport = createTypicalSDKDelegationEventReport(); apiDelegationEventReport = new DelegationEventReportConverter(sdkDelegationEventReport).toAPIDelegationEventReport(); - assertThat("Converter returned a null sdk object for a non null api object", apiDelegationEventReport, is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", apiDelegationEventReport, notNullValue()); assertThat("EventDate was not correctly set", apiDelegationEventReport.getEventDate(), is(sdkDelegationEventReport.getEventDate())); assertThat("EventDescription was not correctly set", apiDelegationEventReport.getEventDescription(), is(sdkDelegationEventReport.getEventDescription())); assertThat("EventType was not correctly set", apiDelegationEventReport.getEventType(), is(sdkDelegationEventReport.getEventType())); diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationReportConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationReportConverterTest.java index f1baf2a05..7300a15fd 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationReportConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationReportConverterTest.java @@ -14,7 +14,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 7/14/16. @@ -33,7 +32,7 @@ public class DelegationReportConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkDelegationReport = null; converter = new DelegationReportConverter(sdkDelegationReport); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIDelegationReport(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIDelegationReport(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiDelegationReport = null; converter = new DelegationReportConverter(apiDelegationReport); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKDelegationReport(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKDelegationReport(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkDelegationReport = null; converter = new DelegationReportConverter(sdkDelegationReport); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKDelegationReport(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKDelegationReport(), nullValue()); } @Override @@ -57,7 +56,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiDelegationReport = null; converter = new DelegationReportConverter(apiDelegationReport); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIDelegationReport(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIDelegationReport(), nullValue()); } @Override @@ -66,8 +65,8 @@ public void convertSDKToSDK() { sdkDelegationReport = createTypicalSDKDelegationReport(); sdkDelegationReport = new DelegationReportConverter(sdkDelegationReport).toSDKDelegationReport(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkDelegationReport, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkDelegationReport, is(equalTo(sdkDelegationReport))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkDelegationReport, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkDelegationReport, is(sdkDelegationReport)); } @Override @@ -76,8 +75,8 @@ public void convertAPIToAPI() { apiDelegationReport = createTypicalAPIDelegationReport(); apiDelegationReport = new DelegationReportConverter(apiDelegationReport).toAPIDelegationReport(); - assertThat("Converter returned a null api object for a non null api object", apiDelegationReport, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiDelegationReport, is(equalTo(apiDelegationReport))); + assertThat("Converter returned a null api object for a non null api object", apiDelegationReport, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiDelegationReport, is(apiDelegationReport)); } @Override @@ -86,13 +85,13 @@ public void convertAPIToSDK() { apiDelegationReport = createTypicalAPIDelegationReport(); sdkDelegationReport = new DelegationReportConverter(apiDelegationReport).toSDKDelegationReport(); - assertThat("Converter returned a null sdk object for a non null api object", sdkDelegationReport, is(notNullValue())); - assertThat("DelegationEventReports was not correctly set", sdkDelegationReport.getDelegationEventReports(), is(notNullValue())); - assertThat("DelegationEventReports was not correctly set", sdkDelegationReport.getDelegationEventReports().get(API_DELEGATION_EVENT_REPORTS_KEY), is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", sdkDelegationReport, notNullValue()); + assertThat("DelegationEventReports was not correctly set", sdkDelegationReport.getDelegationEventReports(), notNullValue()); + assertThat("DelegationEventReports was not correctly set", sdkDelegationReport.getDelegationEventReports().get(API_DELEGATION_EVENT_REPORTS_KEY), notNullValue()); DelegationEventReport sdkDelegationEventReport = sdkDelegationReport.getDelegationEventReports().get(API_DELEGATION_EVENT_REPORTS_KEY).get(0); com.silanis.esl.api.model.DelegationEventReport apiDelegationEventReport = - ((List) apiDelegationReport.getDelegationEvents().get(API_DELEGATION_EVENT_REPORTS_KEY)).get(0); + ((List) apiDelegationReport.getDelegationEvents().get(API_DELEGATION_EVENT_REPORTS_KEY)).get(0); assertThat("EventDate was not correctly set", sdkDelegationEventReport.getEventDate(), is(apiDelegationEventReport.getEventDate())); assertThat("EventDescription was not correctly set", sdkDelegationEventReport.getEventDescription(), is(apiDelegationEventReport.getEventDescription())); @@ -109,12 +108,12 @@ public void convertSDKToAPI() { sdkDelegationReport = createTypicalSDKDelegationReport(); apiDelegationReport = new DelegationReportConverter(sdkDelegationReport).toAPIDelegationReport(); - assertThat("Converter returned a null sdk object for a non null api object", apiDelegationReport, is(notNullValue())); - assertThat("DelegationEventReports was not correctly set", apiDelegationReport.getDelegationEvents(), is(notNullValue())); - assertThat("DelegationEventReports was not correctly set", apiDelegationReport.getDelegationEvents().get(SDK_DELEGATION_EVENT_REPORTS_KEY), is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", apiDelegationReport, notNullValue()); + assertThat("DelegationEventReports was not correctly set", apiDelegationReport.getDelegationEvents(), notNullValue()); + assertThat("DelegationEventReports was not correctly set", apiDelegationReport.getDelegationEvents().get(SDK_DELEGATION_EVENT_REPORTS_KEY), notNullValue()); com.silanis.esl.api.model.DelegationEventReport apiDelegationEventReport = - ((List) apiDelegationReport.getDelegationEvents().get(SDK_DELEGATION_EVENT_REPORTS_KEY)).get(0); + ((List) apiDelegationReport.getDelegationEvents().get(SDK_DELEGATION_EVENT_REPORTS_KEY)).get(0); DelegationEventReport sdkDelegationEventReport = sdkDelegationReport.getDelegationEventReports().get(SDK_DELEGATION_EVENT_REPORTS_KEY).get(0); assertThat("EventDate was not correctly set", apiDelegationEventReport.getEventDate(), is(sdkDelegationEventReport.getEventDate())); diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationUserConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationUserConverterTest.java index 24b7b829d..5aacf1526 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationUserConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DelegationUserConverterTest.java @@ -9,7 +9,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 7/14/16. @@ -25,7 +24,7 @@ public class DelegationUserConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkDelegationUser = null; converter = new DelegationUserConverter(sdkDelegationUser); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIDelegationUser(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIDelegationUser(), nullValue()); } @Override @@ -33,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiDelegationUser = null; converter = new DelegationUserConverter(apiDelegationUser); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKDelegationUser(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKDelegationUser(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkDelegationUser = null; converter = new DelegationUserConverter(sdkDelegationUser); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKDelegationUser(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKDelegationUser(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiDelegationUser = null; converter = new DelegationUserConverter(apiDelegationUser); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIDelegationUser(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIDelegationUser(), nullValue()); } @Override @@ -58,8 +57,8 @@ public void convertSDKToSDK() { sdkDelegationUser = createTypicalSDKDelegationUser(); sdkDelegationUser = new DelegationUserConverter(sdkDelegationUser).toSDKDelegationUser(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkDelegationUser, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkDelegationUser, is(equalTo(sdkDelegationUser))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkDelegationUser, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkDelegationUser, is(sdkDelegationUser)); } @Override @@ -68,8 +67,8 @@ public void convertAPIToAPI() { apiDelegationUser = createTypicalAPIDelegationUser(); apiDelegationUser = new DelegationUserConverter(apiDelegationUser).toAPIDelegationUser(); - assertThat("Converter returned a null api object for a non null api object", apiDelegationUser, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiDelegationUser, is(equalTo(apiDelegationUser))); + assertThat("Converter returned a null api object for a non null api object", apiDelegationUser, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiDelegationUser, is(apiDelegationUser)); } @Override @@ -78,7 +77,7 @@ public void convertAPIToSDK() { apiDelegationUser = createTypicalAPIDelegationUser(); sdkDelegationUser = new DelegationUserConverter(apiDelegationUser).toSDKDelegationUser(); - assertThat("Converter returned a null sdk object for a non null api object", sdkDelegationUser, is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", sdkDelegationUser, notNullValue()); assertThat("Name was not correctly set", sdkDelegationUser.getName(), is(apiDelegationUser.getName())); assertThat("Email was not correctly set", sdkDelegationUser.getEmail(), is(apiDelegationUser.getEmail())); assertThat("Id was not correctly set", sdkDelegationUser.getId(), is(apiDelegationUser.getId())); @@ -92,7 +91,7 @@ public void convertSDKToAPI() { sdkDelegationUser = createTypicalSDKDelegationUser(); apiDelegationUser = new DelegationUserConverter(sdkDelegationUser).toAPIDelegationUser(); - assertThat("Converter returned a null api object for a non null sdk object", apiDelegationUser, is(notNullValue())); + assertThat("Converter returned a null api object for a non null sdk object", apiDelegationUser, notNullValue()); assertThat("Name was not correctly set", apiDelegationUser.getName(), is(sdkDelegationUser.getName())); assertThat("Email was not correctly set", apiDelegationUser.getEmail(), is(sdkDelegationUser.getEmail())); assertThat("Id was not correctly set", apiDelegationUser.getId(), is(sdkDelegationUser.getId())); @@ -101,19 +100,19 @@ public void convertSDKToAPI() { } private com.silanis.esl.sdk.DelegationUser createTypicalSDKDelegationUser() { - return DelegationUserBuilder.newDelegationUser(UUID.randomUUID().toString().replace("-","") + "@e-signlive.com") - .withId("sdkId") - .withFirstName("sdkFirstName") - .withLastName("sdkLastName") - .withName("sdkName") - .build(); + return DelegationUserBuilder.newDelegationUser(UUID.randomUUID().toString().replace("-", "") + "@e-signlive.com") + .withId("sdkId") + .withFirstName("sdkFirstName") + .withLastName("sdkLastName") + .withName("sdkName") + .build(); } private com.silanis.esl.api.model.DelegationUser createTypicalAPIDelegationUser() { com.silanis.esl.api.model.DelegationUser apiDelegationUser = new com.silanis.esl.api.model.DelegationUser(); apiDelegationUser.setId("apiId"); apiDelegationUser.setName("apiName"); - apiDelegationUser.setEmail(UUID.randomUUID().toString().replace("-","") + "@e-signlive.com"); + apiDelegationUser.setEmail(UUID.randomUUID().toString().replace("-", "") + "@e-signlive.com"); apiDelegationUser.setFirstName("apiFirstName"); apiDelegationUser.setLastName("apiLastName"); diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DocumentConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DocumentConverterTest.java index f183d14ab..fb324d7db 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DocumentConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DocumentConverterTest.java @@ -37,36 +37,36 @@ public class DocumentConverterTest { public void convertNullSDKToAPI() { sdkDocument1 = null; converter = new DocumentConverter(sdkDocument1); - assertThat( "Converter didn't return a null api object for a null sdk object", converter.toAPIDocument(apiPackage), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIDocument(apiPackage), is(nullValue())); } @Test public void convertNullAPIToSDK() { apiDocument1 = null; converter = new DocumentConverter(apiDocument1, apiPackage); - assertThat( "Converter didn't return a null sdk object for a null api object", converter.toAPIDocument(apiPackage), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toAPIDocument(apiPackage), is(nullValue())); } @Test public void convertNullSDKToSDK() { sdkDocument1 = null; converter = new DocumentConverter(sdkDocument1); - assertThat( "Converter didn't return a null sdk object for a null sdk object", converter.toSDKDocument(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKDocument(), is(nullValue())); } @Test public void convertNullAPIToAPI() { apiDocument1 = null; converter = new DocumentConverter(apiDocument1, apiPackage); - assertThat( "Converter didn't return a null api object for a null api object", converter.toAPIDocument(apiPackage), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIDocument(apiPackage), is(nullValue())); } @Test public void convertSDKToSDK() { sdkDocument1 = createTypicalSDKDocument(); sdkDocument2 = new DocumentConverter(sdkDocument1).toSDKDocument(); - assertThat( "Converter returned a null sdk object for a non null sdk object", sdkDocument2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null sdk object it was given", sdkDocument2, is( equalTo( sdkDocument1 ) ) ); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkDocument2, is(notNullValue())); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkDocument2, is(equalTo(sdkDocument1))); } @Test @@ -74,45 +74,45 @@ public void convertAPIToAPI() { apiDocument1 = createTypicalAPIDocument(); apiDocument2 = new DocumentConverter(apiDocument1, apiPackage).toAPIDocument(apiPackage); - assertThat( "Converter returned a null api object for a non null api object", apiDocument2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null api object it was given", apiDocument2, is( equalTo( apiDocument1 ) ) ); + assertThat("Converter returned a null api object for a non null api object", apiDocument2, is(notNullValue())); + assertThat("Converter didn't return the same non-null api object it was given", apiDocument2, is(equalTo(apiDocument1))); } @Test - public void convertAPIToSDK(){ + public void convertAPIToSDK() { apiDocument1 = createTypicalAPIDocument(); sdkDocument1 = new DocumentConverter(apiDocument1, apiPackage).toSDKDocument(); - assertThat("Converter returned a null api object for a non null sdk object", sdkDocument1, is( notNullValue() ) ); - assertThat("Description was not correctly set", sdkDocument1.getDescription(), is(equalTo(apiDocument1.getDescription()))); - assertThat("Name was not correctly set", sdkDocument1.getName(), is(equalTo(apiDocument1.getName()))); - assertThat("Id was not correctly set", sdkDocument1.getId().toString(), is(equalTo(apiDocument1.getId()))); - assertThat("Index was not correctly set", sdkDocument1.getIndex(), is(equalTo(apiDocument1.getIndex()))); + assertThat("Converter returned a null api object for a non null sdk object", sdkDocument1, is(notNullValue())); + assertThat("Description was not correctly set", sdkDocument1.getDescription(), is(apiDocument1.getDescription())); + assertThat("Name was not correctly set", sdkDocument1.getName(), is(apiDocument1.getName())); + assertThat("Id was not correctly set", sdkDocument1.getId().toString(), is(apiDocument1.getId())); + assertThat("Index was not correctly set", sdkDocument1.getIndex(), is(apiDocument1.getIndex())); assertThat("ExtractionType was not correctly set", sdkDocument1.getExtractionTypes(), is(apiDocument1.getExtractionTypes())); } @Test - public void convertSDKToAPI(){ + public void convertSDKToAPI() { sdkDocument1 = createTypicalSDKDocument(); apiDocument1 = new DocumentConverter(sdkDocument1).toAPIDocumentMetadata(); - assertThat("Converter returned a null api object for a non null sdk object", apiDocument1, is( notNullValue() ) ); - assertThat("Description was not correctly set", sdkDocument1.getDescription(), is(equalTo(apiDocument1.getDescription()))); - assertThat("Name was not correctly set", sdkDocument1.getName(), is(equalTo(apiDocument1.getName()))); - assertThat("Id was not correctly set", sdkDocument1.getId().toString(), is(equalTo(apiDocument1.getId()))); - assertThat("Index was not correctly set", sdkDocument1.getIndex(), is(equalTo(apiDocument1.getIndex()))); + assertThat("Converter returned a null api object for a non null sdk object", apiDocument1, is(notNullValue())); + assertThat("Description was not correctly set", sdkDocument1.getDescription(), is(apiDocument1.getDescription())); + assertThat("Name was not correctly set", sdkDocument1.getName(), is(apiDocument1.getName())); + assertThat("Id was not correctly set", sdkDocument1.getId().toString(), is(apiDocument1.getId())); + assertThat("Index was not correctly set", sdkDocument1.getIndex(), is(apiDocument1.getIndex())); assertThat("ExtractionType was not correctly set", sdkDocument1.getExtractionTypes(), is(apiDocument1.getExtractionTypes())); } - @Test(expected=IllegalArgumentException.class) - public void convertNullSDKtoAPIMetadata(){ + @Test(expected = IllegalArgumentException.class) + public void convertNullSDKtoAPIMetadata() { sdkDocument1 = null; converter = new DocumentConverter(sdkDocument1); converter.toAPIDocumentMetadata(); } @Test - public void convertSDKtoAPIMetadataWithNullId(){ + public void convertSDKtoAPIMetadataWithNullId() { documentInputStream = this.getClass().getClassLoader().getResourceAsStream("document.pdf"); sdkDocument1 = newDocumentWithName("sdkDocument") .fromStream(documentInputStream, DocumentType.PDF) @@ -121,11 +121,11 @@ public void convertSDKtoAPIMetadataWithNullId(){ .withDescription("Unit test null id") .build(); - assertThat("SDK document id is not null", sdkDocument1.getId(), is(nullValue())); + assertThat("SDK document id is not null", sdkDocument1.getId(), nullValue()); } @Test - public void convertSDKtoAPIMetadataWithNullDescription(){ + public void convertSDKtoAPIMetadataWithNullDescription() { documentInputStream = this.getClass().getClassLoader().getResourceAsStream("document.pdf"); sdkDocument1 = newDocumentWithName("sdkDocument") .fromStream(documentInputStream, DocumentType.PDF) @@ -134,11 +134,11 @@ public void convertSDKtoAPIMetadataWithNullDescription(){ .onPage(0)) .build(); - assertThat("SDK document id is not null", sdkDocument1.getDescription(), is(nullValue())); + assertThat("SDK document id is not null", sdkDocument1.getDescription(), nullValue()); } @Test - public void convertSDKtoAPIWithExternal(){ + public void convertSDKtoAPIWithExternal() { String expectedProvider = "dummyprovider"; String expectedExternalId = "dummyid"; String expectedProviderName = "dummyProviderName"; @@ -147,15 +147,15 @@ public void convertSDKtoAPIWithExternal(){ apiDocument1 = new DocumentConverter(sdkDocument1).toAPIDocument(apiPackage); - assertThat("API document External is null", apiDocument1.getExternal(), is(notNullValue())); - assertThat("API document External provider name is not set", apiDocument1.getExternal().getProviderName(), is(equalTo(expectedProviderName))); - assertThat("API document External id is not set", apiDocument1.getExternal().getId(), is(equalTo(expectedExternalId))); - assertThat("API document External provider is not set", apiDocument1.getExternal().getProvider(), is(equalTo(expectedProvider))); + assertThat("API document External is null", apiDocument1.getExternal(), notNullValue()); + assertThat("API document External provider name is not set", apiDocument1.getExternal().getProviderName(), is(expectedProviderName)); + assertThat("API document External id is not set", apiDocument1.getExternal().getId(), is(expectedExternalId)); + assertThat("API document External provider is not set", apiDocument1.getExternal().getProvider(), is(expectedProvider)); } @Test - public void convertSDKtoAPIWithData(){ + public void convertSDKtoAPIWithData() { String attributeName = "name"; String attributeValue = "value"; @@ -177,7 +177,7 @@ private com.silanis.esl.sdk.Document createDocumentWithData(final String name, f sdkDocument = newDocumentWithName("sdkDocument") .fromStream(documentInputStream, DocumentType.PDF) .withId("sdkDocumentId") - .withData((Map)new HashMap() {{ + .withData((Map) new HashMap() {{ put(name, value); }}) .build(); @@ -188,7 +188,7 @@ private com.silanis.esl.sdk.Document createDocumentWithData(final String name, f private com.silanis.esl.sdk.Document createDocumentWithExternal(String expectedProvider, String expectedExternalId, String expectedProviderName) { com.silanis.esl.sdk.Document sdkDocument; documentInputStream = this.getClass().getClassLoader() - .getResourceAsStream("document.pdf"); + .getResourceAsStream("document.pdf"); sdkDocument = newDocumentWithName("sdkDocument") .fromStream(documentInputStream, DocumentType.PDF) diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DocumentPackageConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DocumentPackageConverterTest.java index da89d2bed..f5c111d05 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DocumentPackageConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/DocumentPackageConverterTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.Date; import java.util.Locale; @@ -18,15 +18,13 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * User: jessica * Date: 26/11/13 * Time: 3:16 PM - * + *

* Test DocumentPackageConverter. - * */ public class DocumentPackageConverterTest implements ConverterTest { @@ -41,7 +39,7 @@ public class DocumentPackageConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkDocumentPackage1 = null; converter = new DocumentPackageConverter(sdkDocumentPackage1); - assertThat( "Converter didn't return a null api object for a null sdk object", converter.toAPIPackage(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIPackage(), nullValue()); } @Override @@ -49,7 +47,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiPackage1 = null; converter = new DocumentPackageConverter(apiPackage1); - assertThat( "Converter didn't return a null sdk object for a null api object", converter.toSDKPackage(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKPackage(), nullValue()); } @Override @@ -57,7 +55,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkDocumentPackage1 = null; converter = new DocumentPackageConverter(sdkDocumentPackage1); - assertThat( "Converter didn't return a null sdk object for a null sdk object", converter.toSDKPackage(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKPackage(), nullValue()); } @Override @@ -65,7 +63,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiPackage1 = null; converter = new DocumentPackageConverter(apiPackage1); - assertThat( "Converter didn't return a null api object for a null api object", converter.toAPIPackage(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIPackage(), nullValue()); } @Override @@ -74,8 +72,8 @@ public void convertSDKToSDK() { sdkDocumentPackage1 = createTypicalSDKDocumentPackage(); sdkDocumentPackage2 = new DocumentPackageConverter(sdkDocumentPackage1).toSDKPackage(); - assertThat( "Converter returned a null sdk object for a non null sdk object", sdkDocumentPackage2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null sdk object it was given", sdkDocumentPackage2, is( equalTo( sdkDocumentPackage1 ) ) ); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkDocumentPackage2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkDocumentPackage2, is(sdkDocumentPackage1)); } @Override @@ -85,8 +83,8 @@ public void convertAPIToAPI() { apiPackage1 = createTypicalAPIDocumentPackage(); apiPackage2 = new DocumentPackageConverter(apiPackage1).toAPIPackage(); - assertThat( "Converter returned a null api object for a non null api object", apiPackage2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null api object it was given", apiPackage2, is( equalTo( apiPackage1 ) ) ); + assertThat("Converter returned a null api object for a non null api object", apiPackage2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiPackage2, is(apiPackage1)); } @Override @@ -95,18 +93,18 @@ public void convertAPIToSDK() { apiPackage1 = createTypicalAPIDocumentPackage(); sdkDocumentPackage1 = new DocumentPackageConverter(apiPackage1).toSDKPackage(); - assertThat("Converter returned a null sdk object for a non null api object", sdkDocumentPackage1, is( notNullValue() ) ); - assertThat("ID was not correctly set", apiPackage1.getId(), is( equalTo(sdkDocumentPackage1.getId().toString()) )); - assertThat("Language was not correctly set", apiPackage1.getLanguage(), is( equalTo(sdkDocumentPackage1.getLanguage().getLanguage()) )); - assertThat("Auto complete was not correctly set", apiPackage1.getAutocomplete(), is( equalTo(sdkDocumentPackage1.getAutocomplete()) )); - assertThat("Description was not correctly set", apiPackage1.getDescription(), is( equalTo(sdkDocumentPackage1.getDescription()) )); - assertThat("Due date was not correctly set", apiPackage1.getDue(), is( equalTo(sdkDocumentPackage1.getExpiryDate()) )); - assertThat("Message was not correctly set", apiPackage1.getEmailMessage(), is( equalTo(sdkDocumentPackage1.getPackageMessage()) )); - assertThat("Name was not correctly set", apiPackage1.getName(), is( equalTo(sdkDocumentPackage1.getName()) )); - assertThat("Status was not correctly set", apiPackage1.getStatus(), is(equalTo(sdkDocumentPackage1.getStatus().getApiValue()))); - assertThat("Message status was not correctly set", apiPackage1.getMessages().get(0).getStatus().toString(), is(equalTo(sdkDocumentPackage1.getMessages().get(0).getStatus().toString()))); - assertThat("Message content was not correctly set", apiPackage1.getMessages().get(0).getContent(), is(equalTo(sdkDocumentPackage1.getMessages().get(0).getContent()))); - assertThat("Sender email address was not correctly set", apiPackage1.getSender().getEmail(), is(equalTo(sdkDocumentPackage1.getSenderInfo().getEmail()))); + assertThat("Converter returned a null sdk object for a non null api object", sdkDocumentPackage1, notNullValue()); + assertThat("ID was not correctly set", apiPackage1.getId(), is(sdkDocumentPackage1.getId().toString())); + assertThat("Language was not correctly set", apiPackage1.getLanguage(), is(sdkDocumentPackage1.getLanguage().getLanguage())); + assertThat("Auto complete was not correctly set", apiPackage1.getAutocomplete(), is(sdkDocumentPackage1.getAutocomplete())); + assertThat("Description was not correctly set", apiPackage1.getDescription(), is(sdkDocumentPackage1.getDescription())); + assertThat("Due date was not correctly set", apiPackage1.getDue(), is(sdkDocumentPackage1.getExpiryDate())); + assertThat("Message was not correctly set", apiPackage1.getEmailMessage(), is(sdkDocumentPackage1.getPackageMessage())); + assertThat("Name was not correctly set", apiPackage1.getName(), is(sdkDocumentPackage1.getName())); + assertThat("Status was not correctly set", apiPackage1.getStatus(), is(sdkDocumentPackage1.getStatus().getApiValue())); + assertThat("Message status was not correctly set", apiPackage1.getMessages().get(0).getStatus(), is(sdkDocumentPackage1.getMessages().get(0).getStatus().toString())); + assertThat("Message content was not correctly set", apiPackage1.getMessages().get(0).getContent(), is(sdkDocumentPackage1.getMessages().get(0).getContent())); + assertThat("Sender email address was not correctly set", apiPackage1.getSender().getEmail(), is(sdkDocumentPackage1.getSenderInfo().getEmail())); assertThat("Creation date was not correctly set", apiPackage1.getCreated(), is(sdkDocumentPackage1.getCreatedDate())); assertThat("Timezone ID was not correctly set", apiPackage1.getTimezoneId(), is(sdkDocumentPackage1.getTimezoneId())); } @@ -118,16 +116,16 @@ public void convertSDKToAPI() { sdkDocumentPackage1 = createTypicalSDKDocumentPackage(); apiPackage1 = new DocumentPackageConverter(sdkDocumentPackage1).toAPIPackage(); - assertThat("Converter returned a null api object for a non null sdk object", apiPackage1, is( notNullValue() ) ); - assertThat("ID was not correctly set", apiPackage1.getId(), is( equalTo(sdkDocumentPackage1.getId().toString()) )); - assertThat("Language was not correctly set", apiPackage1.getLanguage(), is( equalTo(sdkDocumentPackage1.getLanguage().getLanguage() ) )); - assertThat("Auto complete was not correctly set", apiPackage1.getAutocomplete(), is( equalTo(sdkDocumentPackage1.getAutocomplete() ) )); - assertThat("Description was not correctly set", apiPackage1.getDescription(), is( equalTo(sdkDocumentPackage1.getDescription() ) )); - assertThat("Due date was not correctly set", apiPackage1.getDue(), is( equalTo(sdkDocumentPackage1.getExpiryDate() ) )); - assertThat("Message was not correctly set", apiPackage1.getEmailMessage(), is( equalTo(sdkDocumentPackage1.getPackageMessage()) )); - assertThat("Name was not correctly set", apiPackage1.getName(), is( equalTo(sdkDocumentPackage1.getName() ) )); - assertThat("Status was not correctly set", apiPackage1.getStatus(), is( equalTo(sdkDocumentPackage1.getStatus().getApiValue() ) )); - assertThat("Timezone ID was not correctly set", apiPackage1.getTimezoneId(), is( equalTo(sdkDocumentPackage1.getTimezoneId() ) )); + assertThat("Converter returned a null api object for a non null sdk object", apiPackage1, notNullValue()); + assertThat("ID was not correctly set", apiPackage1.getId(), is(sdkDocumentPackage1.getId().toString())); + assertThat("Language was not correctly set", apiPackage1.getLanguage(), is(sdkDocumentPackage1.getLanguage().getLanguage())); + assertThat("Auto complete was not correctly set", apiPackage1.getAutocomplete(), is(sdkDocumentPackage1.getAutocomplete())); + assertThat("Description was not correctly set", apiPackage1.getDescription(), is(sdkDocumentPackage1.getDescription())); + assertThat("Due date was not correctly set", apiPackage1.getDue(), is(sdkDocumentPackage1.getExpiryDate())); + assertThat("Message was not correctly set", apiPackage1.getEmailMessage(), is(sdkDocumentPackage1.getPackageMessage())); + assertThat("Name was not correctly set", apiPackage1.getName(), is(sdkDocumentPackage1.getName())); + assertThat("Status was not correctly set", apiPackage1.getStatus(), is(sdkDocumentPackage1.getStatus().getApiValue())); + assertThat("Timezone ID was not correctly set", apiPackage1.getTimezoneId(), is(sdkDocumentPackage1.getTimezoneId())); } /** @@ -174,7 +172,7 @@ private com.silanis.esl.api.model.Package createTypicalAPIDocumentPackage() { fromUser.setLastName("Smith"); fromUser.setEmail("email@email.com"); apiMessage.setFrom(fromUser); - apiDocumentPackage.setMessages(new ArrayList(Arrays.asList(apiMessage))); + apiDocumentPackage.setMessages(new ArrayList(Collections.singletonList(apiMessage))); Sender sender = new Sender(); sender.setEmail("sender@email.com"); diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ErrorConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ErrorConverterTest.java index ad10bf572..5cd57fdbe 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ErrorConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ErrorConverterTest.java @@ -13,7 +13,7 @@ /** * Created by chi-wing on 5/28/14. */ -public class ErrorConverterTest implements ConverterTest{ +public class ErrorConverterTest implements ConverterTest { private ServerError sdkError1 = null; private ServerError sdkError2 = null; @@ -26,7 +26,7 @@ public class ErrorConverterTest implements ConverterTest{ public void convertNullSDKToAPI() { sdkError1 = null; converter = new ErrorConverter(sdkError1); - assertThat( "Converter didn't return a null api object for a null sdk object", converter.toAPIError(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIError(), is(nullValue())); } @Override @@ -34,7 +34,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiError1 = null; converter = new ErrorConverter(apiError1); - assertThat( "Converter didn't return a null sdk object for a null api object", converter.toSDKError(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKError(), is(nullValue())); } @Override @@ -42,7 +42,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkError1 = null; converter = new ErrorConverter(sdkError1); - assertThat( "Converter didn't return a null sdk object for a null sdk object", converter.toSDKError(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKError(), is(nullValue())); } @Override @@ -50,7 +50,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiError1 = null; converter = new ErrorConverter(apiError1); - assertThat( "Converter didn't return a null api object for a null api object", converter.toAPIError(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIError(), is(nullValue())); } @Override @@ -59,8 +59,8 @@ public void convertSDKToSDK() { sdkError1 = createTypicalServerError(); sdkError2 = new ErrorConverter(sdkError1).toSDKError(); - assertThat( "Converter returned a null sdk object for a non null sdk object", sdkError2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null sdk object it was given", sdkError2, is( equalTo(sdkError1) ) ); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkError2, is(notNullValue())); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkError2, is(equalTo(sdkError1))); } @Override @@ -70,8 +70,8 @@ public void convertAPIToAPI() { apiError1 = createTypicalAPIError(); apiError2 = new ErrorConverter(apiError1).toAPIError(); - assertThat( "Converter returned a null api object for a non null api object", apiError2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null api object it was given", apiError2, is( equalTo( apiError1 ) ) ); + assertThat("Converter returned a null api object for a non null api object", apiError2, is(notNullValue())); + assertThat("Converter didn't return the same non-null api object it was given", apiError2, is(equalTo(apiError1))); } @Override @@ -80,12 +80,12 @@ public void convertAPIToSDK() { apiError1 = createTypicalAPIError(); sdkError1 = new ErrorConverter(apiError1).toSDKError(); - assertThat("Converter returned a null sdk object for a non null api object", sdkError1, is( notNullValue() ) ); - assertThat("Name was not correctly set", apiError1.getName(), is( equalTo(sdkError1.getName()) ) ); - assertThat("Code was not correctly set", apiError1.getCode(), is(equalTo(sdkError1.getCode()))); - assertThat("Message was not correctly set", apiError1.getMessage(), is(equalTo(sdkError1.getMessage()))); - assertThat("Message key was not correctly set",apiError1.getMessageKey(), is(equalTo(sdkError1.getMessageKey()))); - assertThat("Technical was not correctly set",apiError1.getTechnical(), is(equalTo(sdkError1.getTechnical()))); + assertThat("Converter returned a null sdk object for a non null api object", sdkError1, is(notNullValue())); + assertThat("Name was not correctly set", apiError1.getName(), is(equalTo(sdkError1.getName()))); + assertThat("Code was not correctly set", apiError1.getCode(), is(sdkError1.getCode())); + assertThat("Message was not correctly set", apiError1.getMessage(), is(sdkError1.getMessage())); + assertThat("Message key was not correctly set", apiError1.getMessageKey(), is(sdkError1.getMessageKey())); + assertThat("Technical was not correctly set", apiError1.getTechnical(), is(sdkError1.getTechnical())); } @Override @@ -95,12 +95,12 @@ public void convertSDKToAPI() { sdkError1 = createTypicalServerError(); apiError1 = new ErrorConverter(sdkError1).toAPIError(); - assertThat("Converter returned a null api object for a non null sdk object", sdkError1, is( notNullValue() ) ); - assertThat("Name was not correctly set", apiError1.getName(), is( equalTo(sdkError1.getName()) ) ); - assertThat("Code was not correctly set", apiError1.getCode(), is(equalTo(sdkError1.getCode()))); - assertThat("Message was not correctly set", apiError1.getMessage(), is(equalTo(sdkError1.getMessage()))); - assertThat("Message key was not correctly set",apiError1.getMessageKey(), is(equalTo(sdkError1.getMessageKey()))); - assertThat("Technical was not correctly set",apiError1.getTechnical(), is(equalTo(sdkError1.getTechnical()))); + assertThat("Converter returned a null api object for a non null sdk object", sdkError1, is(notNullValue())); + assertThat("Name was not correctly set", apiError1.getName(), is(equalTo(sdkError1.getName()))); + assertThat("Code was not correctly set", apiError1.getCode(), is(sdkError1.getCode())); + assertThat("Message was not correctly set", apiError1.getMessage(), is(sdkError1.getMessage())); + assertThat("Message key was not correctly set", apiError1.getMessageKey(), is(sdkError1.getMessageKey())); + assertThat("Technical was not correctly set", apiError1.getTechnical(), is(sdkError1.getTechnical())); } private ServerError createTypicalServerError() { diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/EventNotificationConfigConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/EventNotificationConfigConverterTest.java index ce1a1844a..5418001ee 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/EventNotificationConfigConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/EventNotificationConfigConverterTest.java @@ -10,7 +10,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by lena on 2014-06-17. @@ -28,7 +27,7 @@ public class EventNotificationConfigConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkEventNotificationConfig1 = null; converter = new EventNotificationConfigConverter(sdkEventNotificationConfig1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPICallback(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPICallback(), nullValue()); } @Override @@ -36,7 +35,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiCallback1 = null; converter = new EventNotificationConfigConverter(apiCallback1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKEventNotificationConfig(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKEventNotificationConfig(), nullValue()); } @Override @@ -44,7 +43,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkEventNotificationConfig1 = null; converter = new EventNotificationConfigConverter(sdkEventNotificationConfig1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKEventNotificationConfig(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKEventNotificationConfig(), nullValue()); } @Override @@ -52,7 +51,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiCallback1 = null; converter = new EventNotificationConfigConverter(apiCallback1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPICallback(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPICallback(), nullValue()); } @Override @@ -61,8 +60,8 @@ public void convertSDKToSDK() { sdkEventNotificationConfig1 = createTypicalSDKEventNotificationConfig(); sdkEventNotificationConfig2 = new EventNotificationConfigConverter(sdkEventNotificationConfig1).toSDKEventNotificationConfig(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkEventNotificationConfig2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkEventNotificationConfig2, is(equalTo(sdkEventNotificationConfig1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkEventNotificationConfig2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkEventNotificationConfig2, is(sdkEventNotificationConfig1)); } @Override @@ -71,8 +70,8 @@ public void convertAPIToAPI() { apiCallback1 = createTypicalAPICallback(); apiCallback2 = new EventNotificationConfigConverter(apiCallback1).toAPICallback(); - assertThat("Converter returned a null api object for a non null api object", apiCallback2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiCallback2, is(equalTo(apiCallback1))); + assertThat("Converter returned a null api object for a non null api object", apiCallback2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiCallback2, is(apiCallback1)); } @Override @@ -81,7 +80,7 @@ public void convertAPIToSDK() { apiCallback1 = createTypicalAPICallback(); sdkEventNotificationConfig1 = new EventNotificationConfigConverter(apiCallback1).toSDKEventNotificationConfig(); - assertThat("Converter returned a null sdk object for a non null api object", sdkEventNotificationConfig1, is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", sdkEventNotificationConfig1, notNullValue()); assertThat("EventNotificationConfig's url was not set correctly", sdkEventNotificationConfig1.getUrl(), is(apiCallback1.getUrl())); assertThat("EventNotificationConfig should have 3 events", sdkEventNotificationConfig1.getEvents().size(), is(3)); @@ -103,7 +102,7 @@ public void convertSDKToAPI() { sdkEventNotificationConfig1 = createTypicalSDKEventNotificationConfig(); apiCallback1 = new EventNotificationConfigConverter(sdkEventNotificationConfig1).toAPICallback(); - assertThat("Converter returned a null api object for a non null sdk object", apiCallback1, is(notNullValue())); + assertThat("Converter returned a null api object for a non null sdk object", apiCallback1, notNullValue()); assertThat("Callback's url was not set correctly", apiCallback1.getUrl(), is(sdkEventNotificationConfig1.getUrl())); assertThat("Callback should have 3 events", apiCallback1.getEvents().size(), is(3)); diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/EventNotificationConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/EventNotificationConverterTest.java index a574dba7c..92f4f6c93 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/EventNotificationConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/EventNotificationConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by lena on 2014-06-17. @@ -25,7 +24,7 @@ public class EventNotificationConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkNotificationEvent1 = null; converter = new EventNotificationConverter(sdkNotificationEvent1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPICallbackEvent(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPICallbackEvent(), nullValue()); } @Override @@ -33,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiCallbackEvent1 = null; converter = new EventNotificationConverter(apiCallbackEvent1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKNotificationEvent(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKNotificationEvent(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkNotificationEvent1 = null; converter = new EventNotificationConverter(sdkNotificationEvent1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKNotificationEvent(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKNotificationEvent(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiCallbackEvent1 = null; converter = new EventNotificationConverter(apiCallbackEvent1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPICallbackEvent(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPICallbackEvent(), nullValue()); } @Override @@ -58,8 +57,8 @@ public void convertSDKToSDK() { sdkNotificationEvent1 = NotificationEvent.PACKAGE_DECLINE; sdkNotificationEvent2 = new EventNotificationConverter(sdkNotificationEvent1).toSDKNotificationEvent(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkNotificationEvent2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkNotificationEvent2, is(equalTo(sdkNotificationEvent1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkNotificationEvent2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkNotificationEvent2, is(sdkNotificationEvent1)); } @Override @@ -68,8 +67,8 @@ public void convertAPIToAPI() { apiCallbackEvent1 = "PACKAGE_COMPLETE"; apiCallbackEvent2 = new EventNotificationConverter(apiCallbackEvent1).toAPICallbackEvent(); - assertThat("Converter returned a null api object for a non null api object", apiCallbackEvent2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiCallbackEvent2, is(equalTo(apiCallbackEvent1))); + assertThat("Converter returned a null api object for a non null api object", apiCallbackEvent2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiCallbackEvent2, is(apiCallbackEvent1)); } @Override diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ExternalConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ExternalConverterTest.java index 1dfcc4b5d..618a91f8d 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ExternalConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ExternalConverterTest.java @@ -1,19 +1,17 @@ package com.silanis.esl.sdk.internal.converter; import com.silanis.esl.sdk.External; -import org.hamcrest.Matchers; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by chi-wing on 7/8/14. */ -public class ExternalConverterTest implements ConverterTest{ +public class ExternalConverterTest implements ConverterTest { private External sdkExternal1 = null; private External sdkExternal2 = null; private com.silanis.esl.api.model.External apiExternal1 = null; @@ -25,7 +23,7 @@ public class ExternalConverterTest implements ConverterTest{ public void convertNullSDKToAPI() { sdkExternal1 = null; converter = new ExternalConverter(sdkExternal1); - assertThat( "Converter didn't return a null api object for a null sdk object", converter.toAPIExternal(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIExternal(), nullValue()); } @Override @@ -33,7 +31,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiExternal1 = null; converter = new ExternalConverter(apiExternal1); - assertThat( "Converter didn't return a null sdk object for a null api object", converter.toSDKExternal(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKExternal(), nullValue()); } @Override @@ -41,7 +39,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkExternal1 = null; converter = new ExternalConverter(sdkExternal1); - assertThat( "Converter didn't return a null sdk object for a null sdk object", converter.toSDKExternal(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKExternal(), nullValue()); } @Override @@ -49,7 +47,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiExternal1 = null; converter = new ExternalConverter(apiExternal1); - assertThat( "Converter didn't return a null api object for a null api object", converter.toAPIExternal(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIExternal(), nullValue()); } @Override @@ -58,8 +56,8 @@ public void convertSDKToSDK() { sdkExternal1 = createTypicalSDKExternal(); sdkExternal2 = new ExternalConverter(sdkExternal1).toSDKExternal(); - assertThat( "Converter returned a null sdk object for a non null sdk object", sdkExternal2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null sdk object it was given", sdkExternal2, is( equalTo(sdkExternal1) ) ); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkExternal2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkExternal2, is(sdkExternal1)); } @Override @@ -69,8 +67,8 @@ public void convertAPIToAPI() { apiExternal1 = createTypicalAPIExternal(); apiExternal2 = new ExternalConverter(apiExternal1).toAPIExternal(); - assertThat( "Converter returned a null api object for a non null api object", apiExternal2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null api object it was given", apiExternal2, is( equalTo(apiExternal1) ) ); + assertThat("Converter returned a null api object for a non null api object", apiExternal2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiExternal2, is(apiExternal1)); } @Override @@ -79,10 +77,10 @@ public void convertAPIToSDK() { apiExternal1 = createTypicalAPIExternal(); sdkExternal1 = new ExternalConverter(apiExternal1).toSDKExternal(); - assertThat("Converter returned a null api object for a non null sdk object", apiExternal1, is(notNullValue())); - assertThat("id was not properly set or retrieved", apiExternal1.getId(), Matchers.is(Matchers.equalTo(sdkExternal1.getId()))); - assertThat( "provider was not properly set or retrieved", apiExternal1.getProvider(), Matchers.is(Matchers.equalTo(sdkExternal1.getProvider()))); - assertThat( "provider name was not properly set or retrieved", apiExternal1.getProviderName(), Matchers.is(Matchers.equalTo(sdkExternal1.getProviderName()))); + assertThat("Converter returned a null api object for a non null sdk object", apiExternal1, notNullValue()); + assertThat("id was not properly set or retrieved", apiExternal1.getId(), is(sdkExternal1.getId())); + assertThat("provider was not properly set or retrieved", apiExternal1.getProvider(), is(sdkExternal1.getProvider())); + assertThat("provider name was not properly set or retrieved", apiExternal1.getProviderName(), is(sdkExternal1.getProviderName())); } @Override @@ -92,10 +90,10 @@ public void convertSDKToAPI() { sdkExternal1 = createTypicalSDKExternal(); apiExternal1 = new ExternalConverter(sdkExternal1).toAPIExternal(); - assertThat("Converter returned a null api object for a non null sdk object", apiExternal1, is(notNullValue())); - assertThat("id was not properly set or retrieved", apiExternal1.getId(), Matchers.is(Matchers.equalTo(sdkExternal1.getId()))); - assertThat( "provider was not properly set or retrieved", apiExternal1.getProvider(), Matchers.is(Matchers.equalTo(sdkExternal1.getProvider()))); - assertThat( "provider name was not properly set or retrieved", apiExternal1.getProviderName(), Matchers.is(Matchers.equalTo(sdkExternal1.getProviderName()))); + assertThat("Converter returned a null api object for a non null sdk object", apiExternal1, notNullValue()); + assertThat("id was not properly set or retrieved", apiExternal1.getId(), is(sdkExternal1.getId())); + assertThat("provider was not properly set or retrieved", apiExternal1.getProvider(), is(sdkExternal1.getProvider())); + assertThat("provider name was not properly set or retrieved", apiExternal1.getProviderName(), is(sdkExternal1.getProviderName())); } /** diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/FieldConditionConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/FieldConditionConverterTest.java index f5fdc4ec0..485bae022 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/FieldConditionConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/FieldConditionConverterTest.java @@ -77,8 +77,8 @@ public void convertAPIToSDK() { assertThat("Converter returned a null api object for a non null sdk object", apiFieldCondition1, is( notNullValue() ) ); assertThat("Id was not correctly set", apiFieldCondition1.getId(), is( equalTo(sdkFieldCondition1.getId()) ) ); - assertThat("Condition was not correctly set", apiFieldCondition1.getCondition(), is(equalTo(sdkFieldCondition1.getCondition()))); - assertThat("Action not correctly set", apiFieldCondition1.getAction(), is(equalTo(sdkFieldCondition1.getAction()))); + assertThat("Condition was not correctly set", apiFieldCondition1.getCondition(), is(sdkFieldCondition1.getCondition())); + assertThat("Action not correctly set", apiFieldCondition1.getAction(), is(sdkFieldCondition1.getAction())); } @Override @@ -90,8 +90,8 @@ public void convertSDKToAPI() { assertThat("Converter returned a null api object for a non null sdk object", apiFieldCondition1, is( notNullValue() ) ); assertThat("Id coordinate was not correctly set", apiFieldCondition1.getId(), is( equalTo(sdkFieldCondition1.getId()) ) ); - assertThat("Condition coordinate was not correctly set", apiFieldCondition1.getCondition(), is(equalTo(sdkFieldCondition1.getCondition()))); - assertThat("Action was not correctly set", apiFieldCondition1.getAction(), is(equalTo(sdkFieldCondition1.getAction()))); + assertThat("Condition coordinate was not correctly set", apiFieldCondition1.getCondition(), is(sdkFieldCondition1.getCondition())); + assertThat("Action was not correctly set", apiFieldCondition1.getAction(), is(sdkFieldCondition1.getAction())); } /** diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/FieldConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/FieldConverterTest.java index 668d987ac..cf3d0e077 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/FieldConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/FieldConverterTest.java @@ -86,14 +86,14 @@ public void convertAPIToSDK() { assertThat("Converter returned a null api object for a non null sdk object", apiField1, is( notNullValue() ) ); assertThat("Left coordinate was not correctly set", apiField1.getLeft(), is( equalTo(sdkField1.getX()) ) ); - assertThat("Top coordinate was not correctly set", apiField1.getTop(), is(equalTo(sdkField1.getY()))); - assertThat("Width was not correctly set", apiField1.getWidth(), is(equalTo(sdkField1.getWidth()))); - assertThat("Height was not correctly set",apiField1.getHeight(), is(equalTo(sdkField1.getHeight()))); - assertThat("Page was not correctly set",apiField1.getPage(), is(equalTo(sdkField1.getPage()))); - assertThat("Extract was not correctly set",apiField1.getExtract(), is(equalTo(sdkField1.isExtraction()))); - assertThat("Value was not correctly set",apiField1.getValue(), is(equalTo(sdkField1.getValue()))); - assertThat("ID was not correctly set", apiField1.getId(), is(equalTo(sdkField1.getId().toString()))); - assertThat("Name was not correctly set", apiField1.getName(), is(equalTo(sdkField1.getName()))); + assertThat("Top coordinate was not correctly set", apiField1.getTop(), is(sdkField1.getY())); + assertThat("Width was not correctly set", apiField1.getWidth(), is(sdkField1.getWidth())); + assertThat("Height was not correctly set",apiField1.getHeight(), is(sdkField1.getHeight())); + assertThat("Page was not correctly set",apiField1.getPage(), is(sdkField1.getPage())); + assertThat("Extract was not correctly set",apiField1.getExtract(), is(sdkField1.isExtraction())); + assertThat("Value was not correctly set",apiField1.getValue(), is(sdkField1.getValue())); + assertThat("ID was not correctly set", apiField1.getId(), is(sdkField1.getId().toString())); + assertThat("Name was not correctly set", apiField1.getName(), is(sdkField1.getName())); } @Override @@ -105,14 +105,14 @@ public void convertSDKToAPI() { assertThat("Converter returned a null api object for a non null sdk object", apiField1, is( notNullValue() ) ); assertThat("Left coordinate was not correctly set", apiField1.getLeft(), is( equalTo(sdkField1.getX()) ) ); - assertThat("Top coordinate was not correctly set", apiField1.getTop(), is(equalTo(sdkField1.getY()))); - assertThat("Width was not correctly set", apiField1.getWidth(), is(equalTo(sdkField1.getWidth()))); - assertThat("Height was not correctly set",apiField1.getHeight(), is(equalTo(sdkField1.getHeight()))); - assertThat("Page was not correctly set",apiField1.getPage(), is(equalTo(sdkField1.getPage()))); - assertThat("Extract was not correctly set",apiField1.getExtract(), is(equalTo(sdkField1.isExtraction()))); - assertThat("Value was not correctly set",apiField1.getValue(), is(equalTo(sdkField1.getValue()))); - assertThat("ID was not correctly set", apiField1.getId(), is(equalTo(sdkField1.getId().toString()))); - assertThat("Name was not correctly set", apiField1.getName(), is(equalTo(sdkField1.getName()))); + assertThat("Top coordinate was not correctly set", apiField1.getTop(), is(sdkField1.getY())); + assertThat("Width was not correctly set", apiField1.getWidth(), is(sdkField1.getWidth())); + assertThat("Height was not correctly set",apiField1.getHeight(), is(sdkField1.getHeight())); + assertThat("Page was not correctly set",apiField1.getPage(), is(sdkField1.getPage())); + assertThat("Extract was not correctly set",apiField1.getExtract(), is(sdkField1.isExtraction())); + assertThat("Value was not correctly set",apiField1.getValue(), is(sdkField1.getValue())); + assertThat("ID was not correctly set", apiField1.getId(), is(sdkField1.getId().toString())); + assertThat("Name was not correctly set", apiField1.getName(), is(sdkField1.getName())); } /** diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/GroupConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/GroupConverterTest.java index 625cd772f..59a3d2af3 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/GroupConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/GroupConverterTest.java @@ -87,10 +87,10 @@ public void convertAPIToSDK() { sdkGroup1 = new GroupConverter(apiGroup1).toSDKGroup(); assertThat("Converter returned a null api object for a non null sdk object", apiGroup1, is( notNullValue() ) ); - assertThat("ID was not correctly set", apiGroup1.getId(), is(equalTo(sdkGroup1.getId().toString()))); - assertThat("Name was not correctly set", apiGroup1.getName(), is(equalTo(sdkGroup1.getName()))); - assertThat("Email was not correctly set", apiGroup1.getEmail(), is(equalTo(sdkGroup1.getEmail()))); - assertThat("Email member flag was not correctly set", apiGroup1.getEmailMembers(), is(equalTo(sdkGroup1.getEmailMembers()))); + assertThat("ID was not correctly set", apiGroup1.getId(), is(sdkGroup1.getId().toString())); + assertThat("Name was not correctly set", apiGroup1.getName(), is(sdkGroup1.getName())); + assertThat("Email was not correctly set", apiGroup1.getEmail(), is(sdkGroup1.getEmail())); + assertThat("Email member flag was not correctly set", apiGroup1.getEmailMembers(), is(sdkGroup1.getEmailMembers())); } @Override @@ -101,12 +101,12 @@ public void convertSDKToAPI() { apiGroup1 = new GroupConverter(sdkGroup1).toAPIGroup(); assertThat("Converter returned a null api object for a non null sdk object", apiGroup1, is( notNullValue() ) ); - assertThat("ID was not correctly set", apiGroup1.getId(), is(equalTo(sdkGroup1.getId().toString()))); - assertThat("Name was not correctly set", apiGroup1.getName(), is(equalTo(sdkGroup1.getName()))); - assertThat("Create date was not correctly set", apiGroup1.getCreated(), is(equalTo(sdkGroup1.getCreated()))); - assertThat("Update date was not correctly set", apiGroup1.getUpdated(), is(equalTo(sdkGroup1.getUpdated()))); - assertThat("Email was not correctly set", apiGroup1.getEmail(), is(equalTo(sdkGroup1.getEmail()))); - assertThat("Email member flag was not correctly set", apiGroup1.getEmailMembers(), is(equalTo(sdkGroup1.getEmailMembers()))); + assertThat("ID was not correctly set", apiGroup1.getId(), is(sdkGroup1.getId().toString())); + assertThat("Name was not correctly set", apiGroup1.getName(), is(sdkGroup1.getName())); + assertThat("Create date was not correctly set", apiGroup1.getCreated(), is(sdkGroup1.getCreated())); + assertThat("Update date was not correctly set", apiGroup1.getUpdated(), is(sdkGroup1.getUpdated())); + assertThat("Email was not correctly set", apiGroup1.getEmail(), is(sdkGroup1.getEmail())); + assertThat("Email member flag was not correctly set", apiGroup1.getEmailMembers(), is(sdkGroup1.getEmailMembers())); } /** diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/GroupSummaryConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/GroupSummaryConverterTest.java index a0512c9a2..152056628 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/GroupSummaryConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/GroupSummaryConverterTest.java @@ -26,7 +26,7 @@ public class GroupSummaryConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkGroupSummary = null; converter = new GroupSummaryConverter(sdkGroupSummary); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIGroupSummary(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIGroupSummary(), nullValue()); } @Override @@ -34,7 +34,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiGroupSummary = null; converter = new GroupSummaryConverter(apiGroupSummary); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKGroupSummary(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKGroupSummary(), nullValue()); } @Override @@ -42,7 +42,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkGroupSummary = null; converter = new GroupSummaryConverter(sdkGroupSummary); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKGroupSummary(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKGroupSummary(), nullValue()); } @Override @@ -50,7 +50,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiGroupSummary = null; converter = new GroupSummaryConverter(apiGroupSummary); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIGroupSummary(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIGroupSummary(), nullValue()); } @Override @@ -59,8 +59,8 @@ public void convertSDKToSDK() { sdkGroupSummary = createTypicalSDKGroupSummary(); sdkGroupSummary = new GroupSummaryConverter(sdkGroupSummary).toSDKGroupSummary(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkGroupSummary, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkGroupSummary, is(equalTo(sdkGroupSummary))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkGroupSummary, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkGroupSummary, is(sdkGroupSummary)); } @Override @@ -69,8 +69,8 @@ public void convertAPIToAPI() { apiGroupSummary = createTypicalAPIGroupSummary(); apiGroupSummary = new GroupSummaryConverter(apiGroupSummary).toAPIGroupSummary(); - assertThat("Converter returned a null api object for a non null api object", apiGroupSummary, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiGroupSummary, is(equalTo(apiGroupSummary))); + assertThat("Converter returned a null api object for a non null api object", apiGroupSummary, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiGroupSummary, is(apiGroupSummary)); } @Override @@ -79,7 +79,7 @@ public void convertAPIToSDK() { apiGroupSummary = createTypicalAPIGroupSummary(); sdkGroupSummary = new GroupSummaryConverter(apiGroupSummary).toSDKGroupSummary(); - assertThat("Converter returned a null sdk object for a non null api object", sdkGroupSummary, is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", sdkGroupSummary, notNullValue()); assertThat("Id was not correctly set", sdkGroupSummary.getId(), is(apiGroupSummary.getId())); assertThat("Name was not correctly set", sdkGroupSummary.getName(), is(apiGroupSummary.getName())); assertThat("Email was not correctly set", sdkGroupSummary.getEmail(), is(apiGroupSummary.getEmail())); @@ -92,7 +92,7 @@ public void convertSDKToAPI() { sdkGroupSummary = createTypicalSDKGroupSummary(); apiGroupSummary = new GroupSummaryConverter(sdkGroupSummary).toAPIGroupSummary(); - assertThat("Converter returned a null api object for a non null sdk object", apiGroupSummary, is(notNullValue())); + assertThat("Converter returned a null api object for a non null sdk object", apiGroupSummary, notNullValue()); assertThat("Id was not correctly set", apiGroupSummary.getId(), is(sdkGroupSummary.getId())); assertThat("Name was not correctly set", apiGroupSummary.getName(), is(sdkGroupSummary.getName())); assertThat("Email was not correctly set", apiGroupSummary.getEmail(), is(sdkGroupSummary.getEmail())); diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ImageConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ImageConverterTest.java index 826645926..191466d15 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ImageConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/ImageConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 7/14/16. @@ -23,7 +22,7 @@ public class ImageConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkImage = null; converter = new ImageConverter(sdkImage); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIImage(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIImage(), nullValue()); } @Override @@ -31,7 +30,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiImage = null; converter = new ImageConverter(apiImage); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKImage(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKImage(), nullValue()); } @Override @@ -39,7 +38,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkImage = null; converter = new ImageConverter(sdkImage); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKImage(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKImage(), nullValue()); } @Override @@ -47,7 +46,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiImage = null; converter = new ImageConverter(apiImage); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIImage(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIImage(), nullValue()); } @Override @@ -56,8 +55,8 @@ public void convertSDKToSDK() { sdkImage = createTypicalSDKImage(); sdkImage = new ImageConverter(sdkImage).toSDKImage(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkImage, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkImage, is(equalTo(sdkImage))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkImage, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkImage, is(sdkImage)); } @Override @@ -66,8 +65,8 @@ public void convertAPIToAPI() { apiImage = createTypicalAPIAuthImage(); apiImage = new ImageConverter(apiImage).toAPIImage(); - assertThat("Converter returned a null api object for a non null api object", apiImage, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiImage, is(equalTo(apiImage))); + assertThat("Converter returned a null api object for a non null api object", apiImage, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiImage, is(apiImage)); } @Override @@ -76,7 +75,7 @@ public void convertAPIToSDK() { apiImage = createTypicalAPIAuthImage(); sdkImage = new ImageConverter(apiImage).toSDKImage(); - assertThat("Converter returned a null sdk object for a non null api object", sdkImage, is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", sdkImage, notNullValue()); assertThat("Link was not correctly set", sdkImage.getLink(), is(apiImage.getLink())); assertThat("Src was not correctly set", sdkImage.getSrc(), is(apiImage.getSrc())); } @@ -87,7 +86,7 @@ public void convertSDKToAPI() { sdkImage = createTypicalSDKImage(); apiImage = new ImageConverter(sdkImage).toAPIImage(); - assertThat("Converter returned a null api object for a non null sdk object", apiImage, is(notNullValue())); + assertThat("Converter returned a null api object for a non null sdk object", apiImage, notNullValue()); assertThat("Link was not correctly set", apiImage.getLink(), is(sdkImage.getLink())); assertThat("Src was not correctly set", apiImage.getSrc(), is(sdkImage.getSrc())); } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/KnowledgeBasedAuthenticationConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/KnowledgeBasedAuthenticationConverterTest.java index b454433df..2f3d00f08 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/KnowledgeBasedAuthenticationConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/KnowledgeBasedAuthenticationConverterTest.java @@ -48,46 +48,46 @@ public class KnowledgeBasedAuthenticationConverterTest implements ConverterTest public void convertNullSDKToAPI() { sdkKBA = null; converter = new KnowledgeBasedAuthenticationConverter(sdkKBA); - assertThat( "Converter didn't return a null api object for a null sdk object", converter.toAPIKnowledgeBasedAuthentication(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIKnowledgeBasedAuthentication(), is(nullValue())); } @Test public void convertNullAPIToSDK() { apiKBA = null; converter = new KnowledgeBasedAuthenticationConverter(apiKBA); - assertThat( "Converter didn't return a null sdk object for a null api object", converter.toSDKKnowledgeBasedAuthentication(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKKnowledgeBasedAuthentication(), is(nullValue())); } @Test public void convertNullSDKToSDK() { sdkKBA = null; converter = new KnowledgeBasedAuthenticationConverter(sdkKBA); - assertThat( "Converter didn't return a null sdk object for a null sdk object", converter.toSDKKnowledgeBasedAuthentication(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKKnowledgeBasedAuthentication(), is(nullValue())); } @Test public void convertNullAPIToAPI() { apiKBA = null; converter = new KnowledgeBasedAuthenticationConverter(apiKBA); - assertThat( "Converter didn't return a null api object for a null api object", converter.toAPIKnowledgeBasedAuthentication(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIKnowledgeBasedAuthentication(), is(nullValue())); } @Test public void convertSDKToSDK() { sdkKBA = new KnowledgeBasedAuthentication(); - converter = new KnowledgeBasedAuthenticationConverter( sdkKBA ); + converter = new KnowledgeBasedAuthenticationConverter(sdkKBA); KnowledgeBasedAuthentication result = converter.toSDKKnowledgeBasedAuthentication(); - assertThat( "Converter returned a null sdk object for a non null sdk object", result, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null sdk object it was given", result, is( equalTo( sdkKBA ) ) ); + assertThat("Converter returned a null sdk object for a non null sdk object", result, is(notNullValue())); + assertThat("Converter didn't return the same non-null sdk object it was given", result, is(equalTo(sdkKBA))); } @Test public void convertAPIToAPI() { apiKBA = new com.silanis.esl.api.model.KnowledgeBasedAuthentication(); - converter = new KnowledgeBasedAuthenticationConverter( apiKBA ); + converter = new KnowledgeBasedAuthenticationConverter(apiKBA); com.silanis.esl.api.model.KnowledgeBasedAuthentication result = converter.toAPIKnowledgeBasedAuthentication(); - assertThat( "Converter returned a null api object for a non null api object", result, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null api object it was given", result, is( equalTo( apiKBA ) ) ); + assertThat("Converter returned a null api object for a non null api object", result, is(notNullValue())); + assertThat("Converter didn't return the same non-null api object it was given", result, is(equalTo(apiKBA))); } @Test @@ -95,22 +95,22 @@ public void convertAPIToSDK() { apiKBA = createTypicalAPIKnowledgeBasedAuthentication(); sdkKBA = new KnowledgeBasedAuthenticationConverter(apiKBA).toSDKKnowledgeBasedAuthentication(); - assertThat("Converter returned a null api object for a non null sdk object", apiKBA, is(notNullValue())); - assertThat("KBA status was not properly set or retrieved", apiKBA.getKnowledgeBasedAuthenticationStatus(), is(equalTo(sdkKBA.getKnowledgeBasedAuthenticationStatus().toString()))); - - assertThat("Signer information (First Name) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getFirstName(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getFirstName()))); - assertThat("Signer information (Last Name) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getLastName(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getLastName()))); - assertThat("Signer information (Address) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getStreetAddress(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getStreetAddress()))); - assertThat("Signer information (City) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getCity(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getCity()))); - assertThat("Signer information (Postal Code) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getPostalCode(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getPostalCode()))); - assertThat("Signer information (Province) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getProvince(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getProvince()))); - assertThat("Signer information (Time at address) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getTimeAtAddress(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getTimeAtAddress()))); - assertThat("Signer information (Date of Birth) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getDateOfBirth(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getDateOfBirth()))); - assertThat("Signer information (Driver's license) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getDriversLicenseNumber(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getDriversLicenseNumber()))); - assertThat("Signer information (SIN) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getSocialInsuranceNumber(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getSocialInsuranceNumber()))); - assertThat("Signer information (Home Phone number) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getHomePhoneNumber(), is(equalTo(sdkKBA.getSignerInformationForEquifaxCanada().getHomePhoneNumber()))); - - assertThat( "Signer information for Equifax USA was not null", apiKBA.getSignerInformationForEquifaxUSA(), is( nullValue() )); + assertThat("Converter returned a null api object for a non null sdk object", apiKBA, notNullValue()); + assertThat("KBA status was not properly set or retrieved", apiKBA.getKnowledgeBasedAuthenticationStatus(), is(sdkKBA.getKnowledgeBasedAuthenticationStatus().toString())); + + assertThat("Signer information (First Name) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getFirstName(), is(sdkKBA.getSignerInformationForEquifaxCanada().getFirstName())); + assertThat("Signer information (Last Name) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getLastName(), is(sdkKBA.getSignerInformationForEquifaxCanada().getLastName())); + assertThat("Signer information (Address) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getStreetAddress(), is(sdkKBA.getSignerInformationForEquifaxCanada().getStreetAddress())); + assertThat("Signer information (City) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getCity(), is(sdkKBA.getSignerInformationForEquifaxCanada().getCity())); + assertThat("Signer information (Postal Code) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getPostalCode(), is(sdkKBA.getSignerInformationForEquifaxCanada().getPostalCode())); + assertThat("Signer information (Province) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getProvince(), is(sdkKBA.getSignerInformationForEquifaxCanada().getProvince())); + assertThat("Signer information (Time at address) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getTimeAtAddress(), is(sdkKBA.getSignerInformationForEquifaxCanada().getTimeAtAddress())); + assertThat("Signer information (Date of Birth) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getDateOfBirth(), is(sdkKBA.getSignerInformationForEquifaxCanada().getDateOfBirth())); + assertThat("Signer information (Driver's license) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getDriversLicenseNumber(), is(sdkKBA.getSignerInformationForEquifaxCanada().getDriversLicenseNumber())); + assertThat("Signer information (SIN) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getSocialInsuranceNumber(), is(sdkKBA.getSignerInformationForEquifaxCanada().getSocialInsuranceNumber())); + assertThat("Signer information (Home Phone number) for Equifax Canada was not correctly set", apiKBA.getSignerInformationForEquifaxCanada().getHomePhoneNumber(), is(sdkKBA.getSignerInformationForEquifaxCanada().getHomePhoneNumber())); + + assertThat("Signer information for Equifax USA was not null", apiKBA.getSignerInformationForEquifaxUSA(), is(nullValue())); } @Test @@ -118,22 +118,22 @@ public void convertSDKToAPI() { sdkKBA = createTypicalSDKKnowledgeBasedAuthentication(); apiKBA = new KnowledgeBasedAuthenticationConverter(sdkKBA).toAPIKnowledgeBasedAuthentication(); - assertThat("Converter returned a null api object for a non null api object", sdkKBA, is(notNullValue())); - assertThat("KBA status was not properly set or retrieved", sdkKBA.getKnowledgeBasedAuthenticationStatus().toString(), is(equalTo(apiKBA.getKnowledgeBasedAuthenticationStatus()))); - - assertThat( "Signer information for Equifax Canada was not null", sdkKBA.getSignerInformationForEquifaxCanada(), is( nullValue() )); - - assertThat("Signer information (First Name) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getFirstName(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getFirstName()))); - assertThat("Signer information (Last Name) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getLastName(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getLastName()))); - assertThat("Signer information (Address) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getStreetAddress(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getStreetAddress()))); - assertThat("Signer information (City) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getCity(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getCity()))); - assertThat("Signer information (Zip Code) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getZip(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getZip()))); - assertThat("Signer information (State) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getState(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getState()))); - assertThat("Signer information (SSN) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getSocialSecurityNumber(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getSocialSecurityNumber()))); - assertThat("Signer information (Date of Birth) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getDateOfBirth(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getDateOfBirth()))); - assertThat("Signer information (Home Phone number) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getHomePhoneNumber(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getHomePhoneNumber()))); - assertThat("Signer information (Driver's license) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getDriversLicenseNumber(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getDriversLicenseNumber()))); - assertThat("Signer information (Time at address) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getTimeAtAddress(), is(equalTo(apiKBA.getSignerInformationForEquifaxUSA().getTimeAtAddress()))); + assertThat("Converter returned a null api object for a non null api object", sdkKBA, notNullValue()); + assertThat("KBA status was not properly set or retrieved", sdkKBA.getKnowledgeBasedAuthenticationStatus().toString(), is(apiKBA.getKnowledgeBasedAuthenticationStatus())); + + assertThat("Signer information for Equifax Canada was not null", sdkKBA.getSignerInformationForEquifaxCanada(), is(nullValue())); + + assertThat("Signer information (First Name) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getFirstName(), is(apiKBA.getSignerInformationForEquifaxUSA().getFirstName())); + assertThat("Signer information (Last Name) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getLastName(), is(apiKBA.getSignerInformationForEquifaxUSA().getLastName())); + assertThat("Signer information (Address) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getStreetAddress(), is(apiKBA.getSignerInformationForEquifaxUSA().getStreetAddress())); + assertThat("Signer information (City) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getCity(), is(apiKBA.getSignerInformationForEquifaxUSA().getCity())); + assertThat("Signer information (Zip Code) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getZip(), is(apiKBA.getSignerInformationForEquifaxUSA().getZip())); + assertThat("Signer information (State) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getState(), is(apiKBA.getSignerInformationForEquifaxUSA().getState())); + assertThat("Signer information (SSN) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getSocialSecurityNumber(), is(apiKBA.getSignerInformationForEquifaxUSA().getSocialSecurityNumber())); + assertThat("Signer information (Date of Birth) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getDateOfBirth(), is(apiKBA.getSignerInformationForEquifaxUSA().getDateOfBirth())); + assertThat("Signer information (Home Phone number) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getHomePhoneNumber(), is(apiKBA.getSignerInformationForEquifaxUSA().getHomePhoneNumber())); + assertThat("Signer information (Driver's license) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getDriversLicenseNumber(), is(apiKBA.getSignerInformationForEquifaxUSA().getDriversLicenseNumber())); + assertThat("Signer information (Time at address) for Equifax USA was not correctly set", sdkKBA.getSignerInformationForEquifaxUSA().getTimeAtAddress(), is(apiKBA.getSignerInformationForEquifaxUSA().getTimeAtAddress())); } /** diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/KnowledgeBasedAuthenticationStatusConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/KnowledgeBasedAuthenticationStatusConverterTest.java index 85f99a68f..f5379842c 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/KnowledgeBasedAuthenticationStatusConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/KnowledgeBasedAuthenticationStatusConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 9/11/14. @@ -22,28 +21,28 @@ public class KnowledgeBasedAuthenticationStatusConverterTest implements Converte public void convertNullSDKToAPI() { sdkKnowledgeBasedAuthenticationStatus = null; converter = new KnowledgeBasedAuthenticationStatusConverter(sdkKnowledgeBasedAuthenticationStatus); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIKnowledgeBasedAuthenticationStatus(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIKnowledgeBasedAuthenticationStatus(), nullValue()); } @Test public void convertNullAPIToSDK() { apiKnowledgeBasedAuthenticationStatus = null; converter = new KnowledgeBasedAuthenticationStatusConverter(apiKnowledgeBasedAuthenticationStatus); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKKnowledgeBasedAuthenticationStatus(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKKnowledgeBasedAuthenticationStatus(), nullValue()); } @Test public void convertNullSDKToSDK() { sdkKnowledgeBasedAuthenticationStatus = null; converter = new KnowledgeBasedAuthenticationStatusConverter(sdkKnowledgeBasedAuthenticationStatus); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKKnowledgeBasedAuthenticationStatus(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKKnowledgeBasedAuthenticationStatus(), nullValue()); } @Test public void convertNullAPIToAPI() { apiKnowledgeBasedAuthenticationStatus = null; converter = new KnowledgeBasedAuthenticationStatusConverter(apiKnowledgeBasedAuthenticationStatus); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIKnowledgeBasedAuthenticationStatus(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIKnowledgeBasedAuthenticationStatus(), nullValue()); } @Test @@ -52,8 +51,8 @@ public void convertSDKToSDK() { converter = new KnowledgeBasedAuthenticationStatusConverter(sdkKnowledgeBasedAuthenticationStatus); com.silanis.esl.sdk.KnowledgeBasedAuthenticationStatus result = converter.toSDKKnowledgeBasedAuthenticationStatus(); - assertThat("Converter returned a null sdk object for a non null sdk object", result, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", result, is(equalTo(sdkKnowledgeBasedAuthenticationStatus))); + assertThat("Converter returned a null sdk object for a non null sdk object", result, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", result, is(sdkKnowledgeBasedAuthenticationStatus)); } @Test @@ -62,8 +61,8 @@ public void convertAPIToAPI() { converter = new KnowledgeBasedAuthenticationStatusConverter(apiKnowledgeBasedAuthenticationStatus); String result = converter.toAPIKnowledgeBasedAuthenticationStatus(); - assertThat("Converter returned a null api object for a non null api object", result, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", result, is(equalTo(apiKnowledgeBasedAuthenticationStatus))); + assertThat("Converter returned a null api object for a non null api object", result, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", result, is(apiKnowledgeBasedAuthenticationStatus)); } @Test diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/MessageConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/MessageConverterTest.java index 36cee18eb..89f0077e4 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/MessageConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/MessageConverterTest.java @@ -6,13 +6,16 @@ import com.silanis.esl.sdk.builder.SignerBuilder; import org.junit.Test; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by lena on 2014-07-03. @@ -30,7 +33,7 @@ public class MessageConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkMessage1 = null; converter = new MessageConverter(sdkMessage1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIMessage(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIMessage(), nullValue()); } @Override @@ -38,7 +41,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiMessage1 = null; converter = new MessageConverter(apiMessage1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKMessage(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKMessage(), nullValue()); } @Override @@ -46,7 +49,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkMessage1 = null; converter = new MessageConverter(sdkMessage1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKMessage(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKMessage(), nullValue()); } @Override @@ -54,7 +57,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiMessage1 = null; converter = new MessageConverter(apiMessage1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIMessage(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIMessage(), nullValue()); } @Override @@ -63,8 +66,8 @@ public void convertSDKToSDK() { sdkMessage1 = createTypicalSDKMessage(); sdkMessage2 = new MessageConverter(sdkMessage1).toSDKMessage(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkMessage2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkMessage2, is(equalTo(sdkMessage1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkMessage2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkMessage2, is(sdkMessage1)); } @Override @@ -73,8 +76,8 @@ public void convertAPIToAPI() { apiMessage1 = createTypicalAPIMessage(); apiMessage2 = new MessageConverter(apiMessage1).toAPIMessage(); - assertThat("Converter returned a null api object for a non null api object", apiMessage2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiMessage2, is(equalTo(apiMessage1))); + assertThat("Converter returned a null api object for a non null api object", apiMessage2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiMessage2, is(apiMessage1)); } @Override @@ -83,16 +86,16 @@ public void convertAPIToSDK() { apiMessage1 = createTypicalAPIMessage(); sdkMessage1 = new MessageConverter(apiMessage1).toSDKMessage(); - assertThat("Converter returned a null sdk object for a non null api object", sdkMessage1, is(notNullValue())); - assertThat("Message status was not correctly set", sdkMessage1.getStatus().toString(), is(equalTo(apiMessage1.getStatus().toString()))); - assertThat("Message content was not correctly set", sdkMessage1.getContent(), is(equalTo(apiMessage1.getContent()))); + assertThat("Converter returned a null sdk object for a non null api object", sdkMessage1, notNullValue()); + assertThat("Message status was not correctly set", sdkMessage1.getStatus().toString(), is(apiMessage1.getStatus())); + assertThat("Message content was not correctly set", sdkMessage1.getContent(), is(apiMessage1.getContent())); assertThat("Message created date was not correctly set", sdkMessage1.getCreated(), is(apiMessage1.getCreated())); - assertThat("Message from signer first name was not correctly set", sdkMessage1.getFrom().getFirstName(), is(equalTo(apiMessage1.getFrom().getFirstName()))); - assertThat("Message from signer last name was not correctly set", sdkMessage1.getFrom().getLastName(), is(equalTo(apiMessage1.getFrom().getLastName()))); - assertThat("Message from signer email was not correctly set", sdkMessage1.getFrom().getEmail(), is(equalTo(apiMessage1.getFrom().getEmail()))); - assertThat("Message to signer first name was not correctly set", sdkMessage1.getTo().get("email2@email.com").getFirstName(), is(equalTo(apiMessage1.getTo().get(0).getFirstName()))); - assertThat("Message to signer last name was not correctly set", sdkMessage1.getTo().get("email2@email.com").getLastName(), is(equalTo(apiMessage1.getTo().get(0).getLastName()))); - assertThat("Message to signer email was not correctly set", sdkMessage1.getTo().get("email2@email.com").getEmail(), is(equalTo(apiMessage1.getTo().get(0).getEmail()))); + assertThat("Message from signer first name was not correctly set", sdkMessage1.getFrom().getFirstName(), is(apiMessage1.getFrom().getFirstName())); + assertThat("Message from signer last name was not correctly set", sdkMessage1.getFrom().getLastName(), is(apiMessage1.getFrom().getLastName())); + assertThat("Message from signer email was not correctly set", sdkMessage1.getFrom().getEmail(), is(apiMessage1.getFrom().getEmail())); + assertThat("Message to signer first name was not correctly set", sdkMessage1.getTo().get("email2@email.com").getFirstName(), is(apiMessage1.getTo().get(0).getFirstName())); + assertThat("Message to signer last name was not correctly set", sdkMessage1.getTo().get("email2@email.com").getLastName(), is(apiMessage1.getTo().get(0).getLastName())); + assertThat("Message to signer email was not correctly set", sdkMessage1.getTo().get("email2@email.com").getEmail(), is(apiMessage1.getTo().get(0).getEmail())); } @Override @@ -101,16 +104,16 @@ public void convertSDKToAPI() { sdkMessage1 = createTypicalSDKMessage(); apiMessage1 = new MessageConverter(sdkMessage1).toAPIMessage(); - assertThat("Converter returned a null sdk object for a non null api object", apiMessage1, is(notNullValue())); - assertThat("Message status was not correctly set", apiMessage1.getStatus().toString(), is(equalTo(sdkMessage1.getStatus().toString()))); - assertThat("Message content was not correctly set", apiMessage1.getContent(), is(equalTo(sdkMessage1.getContent()))); + assertThat("Converter returned a null sdk object for a non null api object", apiMessage1, notNullValue()); + assertThat("Message status was not correctly set", apiMessage1.getStatus(), is(sdkMessage1.getStatus().toString())); + assertThat("Message content was not correctly set", apiMessage1.getContent(), is(sdkMessage1.getContent())); assertThat("Message created date was not correctly set", apiMessage1.getCreated(), is(sdkMessage1.getCreated())); - assertThat("Message from signer first name was not correctly set", apiMessage1.getFrom().getFirstName(), is(equalTo(sdkMessage1.getFrom().getFirstName()))); - assertThat("Message from signer last name was not correctly set", apiMessage1.getFrom().getLastName(), is(equalTo(sdkMessage1.getFrom().getLastName()))); - assertThat("Message from signer email was not correctly set", apiMessage1.getFrom().getEmail(), is(equalTo(sdkMessage1.getFrom().getEmail()))); - assertThat("Message to signer first name was not correctly set", apiMessage1.getTo().get(0).getFirstName(), is(equalTo(sdkMessage1.getTo().get("email2@email.com").getFirstName()))); - assertThat("Message to signer last name was not correctly set", apiMessage1.getTo().get(0).getLastName(), is(equalTo(sdkMessage1.getTo().get("email2@email.com").getLastName()))); - assertThat("Message to signer email was not correctly set", apiMessage1.getTo().get(0).getEmail(), is(equalTo(sdkMessage1.getTo().get("email2@email.com").getEmail()))); + assertThat("Message from signer first name was not correctly set", apiMessage1.getFrom().getFirstName(), is(sdkMessage1.getFrom().getFirstName())); + assertThat("Message from signer last name was not correctly set", apiMessage1.getFrom().getLastName(), is(sdkMessage1.getFrom().getLastName())); + assertThat("Message from signer email was not correctly set", apiMessage1.getFrom().getEmail(), is(sdkMessage1.getFrom().getEmail())); + assertThat("Message to signer first name was not correctly set", apiMessage1.getTo().get(0).getFirstName(), is(sdkMessage1.getTo().get("email2@email.com").getFirstName())); + assertThat("Message to signer last name was not correctly set", apiMessage1.getTo().get(0).getLastName(), is(sdkMessage1.getTo().get("email2@email.com").getLastName())); + assertThat("Message to signer email was not correctly set", apiMessage1.getTo().get(0).getEmail(), is(sdkMessage1.getTo().get("email2@email.com").getEmail())); } private com.silanis.esl.sdk.Message createTypicalSDKMessage() { diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/MessageStatusConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/MessageStatusConverterTest.java index 1e2cccfb3..08e8f8f89 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/MessageStatusConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/MessageStatusConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by lena on 2014-07-03. @@ -25,7 +24,7 @@ public class MessageStatusConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkMessageStatus1 = null; converter = new MessageStatusConverter(sdkMessageStatus1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIMessageStatus(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIMessageStatus(), nullValue()); } @Override @@ -33,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiMessageStatus1 = null; converter = new MessageStatusConverter(apiMessageStatus1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKMessageStatus(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKMessageStatus(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkMessageStatus1 = null; converter = new MessageStatusConverter(sdkMessageStatus1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKMessageStatus(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKMessageStatus(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiMessageStatus1 = null; converter = new MessageStatusConverter(apiMessageStatus1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIMessageStatus(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIMessageStatus(), nullValue()); } @Override @@ -58,8 +57,8 @@ public void convertSDKToSDK() { sdkMessageStatus1 = com.silanis.esl.sdk.MessageStatus.NEW; sdkMessageStatus2 = new MessageStatusConverter(sdkMessageStatus1).toSDKMessageStatus(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkMessageStatus2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkMessageStatus2, is(equalTo(sdkMessageStatus1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkMessageStatus2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkMessageStatus2, is(sdkMessageStatus1)); } @Override @@ -68,8 +67,8 @@ public void convertAPIToAPI() { apiMessageStatus1 = "READ"; apiMessageStatus2 = new MessageStatusConverter(apiMessageStatus1).toAPIMessageStatus(); - assertThat("Converter returned a null api object for a non null api object", apiMessageStatus2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiMessageStatus2, is(equalTo(apiMessageStatus1))); + assertThat("Converter returned a null api object for a non null api object", apiMessageStatus2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiMessageStatus2, is(apiMessageStatus1)); } @Override diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/NotaryJournalEntryConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/NotaryJournalEntryConverterTest.java index 10591d6c8..7ea7146ff 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/NotaryJournalEntryConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/NotaryJournalEntryConverterTest.java @@ -8,7 +8,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 7/14/16. @@ -24,7 +23,7 @@ public class NotaryJournalEntryConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkNotaryJournalEntry = null; converter = new NotaryJournalEntryConverter(sdkNotaryJournalEntry); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPINotaryJournalEntry(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPINotaryJournalEntry(), nullValue()); } @Override @@ -32,7 +31,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiNotaryJournalEntry = null; converter = new NotaryJournalEntryConverter(apiNotaryJournalEntry); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKNotaryJournalEntry(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKNotaryJournalEntry(), nullValue()); } @Override @@ -40,7 +39,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkNotaryJournalEntry = null; converter = new NotaryJournalEntryConverter(sdkNotaryJournalEntry); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKNotaryJournalEntry(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKNotaryJournalEntry(), nullValue()); } @Override @@ -48,7 +47,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiNotaryJournalEntry = null; converter = new NotaryJournalEntryConverter(apiNotaryJournalEntry); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPINotaryJournalEntry(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPINotaryJournalEntry(), nullValue()); } @Override @@ -57,8 +56,8 @@ public void convertSDKToSDK() { sdkNotaryJournalEntry = createTypicalSDKNotaryJournalEntry(); sdkNotaryJournalEntry = new NotaryJournalEntryConverter(sdkNotaryJournalEntry).toSDKNotaryJournalEntry(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkNotaryJournalEntry, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkNotaryJournalEntry, is(equalTo(sdkNotaryJournalEntry))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkNotaryJournalEntry, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkNotaryJournalEntry, is(sdkNotaryJournalEntry)); } @Override @@ -67,8 +66,8 @@ public void convertAPIToAPI() { apiNotaryJournalEntry = createTypicalAPINotaryJournalEntry(); apiNotaryJournalEntry = new NotaryJournalEntryConverter(apiNotaryJournalEntry).toAPINotaryJournalEntry(); - assertThat("Converter returned a null api object for a non null api object", apiNotaryJournalEntry, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiNotaryJournalEntry, is(equalTo(apiNotaryJournalEntry))); + assertThat("Converter returned a null api object for a non null api object", apiNotaryJournalEntry, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiNotaryJournalEntry, is(apiNotaryJournalEntry)); } @Override @@ -77,7 +76,7 @@ public void convertAPIToSDK() { apiNotaryJournalEntry = createTypicalAPINotaryJournalEntry(); sdkNotaryJournalEntry = new NotaryJournalEntryConverter(apiNotaryJournalEntry).toSDKNotaryJournalEntry(); - assertThat("Converter returned a null sdk object for a non null api object", sdkNotaryJournalEntry, is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", sdkNotaryJournalEntry, notNullValue()); assertThat("Comment was not correctly set", sdkNotaryJournalEntry.getComment(), is(apiNotaryJournalEntry.getComment())); assertThat("CreationDate was not correctly set", sdkNotaryJournalEntry.getCreationDate(), is(apiNotaryJournalEntry.getCreationDate())); assertThat("DocumentName was not correctly set", sdkNotaryJournalEntry.getDocumentName(), is(apiNotaryJournalEntry.getDocumentName())); @@ -96,7 +95,7 @@ public void convertSDKToAPI() { sdkNotaryJournalEntry = createTypicalSDKNotaryJournalEntry(); apiNotaryJournalEntry = new NotaryJournalEntryConverter(sdkNotaryJournalEntry).toAPINotaryJournalEntry(); - assertThat("Converter returned a null api object for a non null sdk object", apiNotaryJournalEntry, is(notNullValue())); + assertThat("Converter returned a null api object for a non null sdk object", apiNotaryJournalEntry, notNullValue()); assertThat("Comment was not correctly set", apiNotaryJournalEntry.getComment(), is(sdkNotaryJournalEntry.getComment())); assertThat("CreationDate was not correctly set", apiNotaryJournalEntry.getCreationDate(), is(sdkNotaryJournalEntry.getCreationDate())); assertThat("DocumentName was not correctly set", apiNotaryJournalEntry.getDocumentName(), is(sdkNotaryJournalEntry.getDocumentName())); @@ -111,17 +110,17 @@ public void convertSDKToAPI() { private com.silanis.esl.sdk.NotaryJournalEntry createTypicalSDKNotaryJournalEntry() { return NotaryJournalEntryBuilder.newNotaryJournalEntry() - .withSequenceNumber(3) - .withCreationDate(new DateTime().minusDays(7).toDate()) - .withDocumentType("sdkDocumentType") - .withDocumentName("sdkDocumentName") - .withSignerName("sdkSignerName") - .withSignatureType("sdkSignatureType") - .withIdType("sdkIdType") - .withIdValue("sdkIdValue") - .withJurisdiction("sdkJurisdiction") - .withComment("sdkComment") - .build(); + .withSequenceNumber(3) + .withCreationDate(new DateTime().minusDays(7).toDate()) + .withDocumentType("sdkDocumentType") + .withDocumentName("sdkDocumentName") + .withSignerName("sdkSignerName") + .withSignatureType("sdkSignatureType") + .withIdType("sdkIdType") + .withIdValue("sdkIdValue") + .withJurisdiction("sdkJurisdiction") + .withComment("sdkComment") + .build(); } private com.silanis.esl.api.model.NotaryJournalEntry createTypicalAPINotaryJournalEntry() { diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/PackageStatusConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/PackageStatusConverterTest.java index e4b1a9b20..e4a60baf8 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/PackageStatusConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/PackageStatusConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by lena on 2014-06-02. @@ -25,7 +24,7 @@ public class PackageStatusConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkPackageStatus1 = null; converter = new PackageStatusConverter(sdkPackageStatus1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIPackageStatus(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIPackageStatus(), nullValue()); } @Override @@ -33,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiPackageStatus1 = null; converter = new PackageStatusConverter(apiPackageStatus1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKPackageStatus(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKPackageStatus(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkPackageStatus1 = null; converter = new PackageStatusConverter(sdkPackageStatus1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKPackageStatus(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKPackageStatus(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiPackageStatus1 = null; converter = new PackageStatusConverter(apiPackageStatus1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIPackageStatus(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIPackageStatus(), nullValue()); } @Override @@ -58,8 +57,8 @@ public void convertSDKToSDK() { sdkPackageStatus1 = com.silanis.esl.sdk.PackageStatus.DRAFT; sdkPackageStatus2 = new PackageStatusConverter(sdkPackageStatus1).toSDKPackageStatus(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkPackageStatus2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkPackageStatus2, is(equalTo(sdkPackageStatus1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkPackageStatus2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkPackageStatus2, is(sdkPackageStatus1)); } @Override @@ -68,8 +67,8 @@ public void convertAPIToAPI() { apiPackageStatus1 = "COMPLETED"; apiPackageStatus2 = new PackageStatusConverter(apiPackageStatus1).toAPIPackageStatus(); - assertThat("Converter returned a null api object for a non null api object", apiPackageStatus2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiPackageStatus2, is(equalTo(apiPackageStatus1))); + assertThat("Converter returned a null api object for a non null api object", apiPackageStatus2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiPackageStatus2, is(apiPackageStatus1)); } @Override diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/RequirementStatusConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/RequirementStatusConverterTest.java index 59163a4b7..426b8ff71 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/RequirementStatusConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/RequirementStatusConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by lena on 2014-06-02. @@ -25,7 +24,7 @@ public class RequirementStatusConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkRequirementStatus1 = null; converter = new RequirementStatusConverter(sdkRequirementStatus1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIRequirementStatus(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIRequirementStatus(), nullValue()); } @Override @@ -33,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiRequirementStatus1 = null; converter = new RequirementStatusConverter(apiRequirementStatus1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKRequirementStatus(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKRequirementStatus(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkRequirementStatus1 = null; converter = new RequirementStatusConverter(sdkRequirementStatus1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKRequirementStatus(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKRequirementStatus(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiRequirementStatus1 = null; converter = new RequirementStatusConverter(apiRequirementStatus1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIRequirementStatus(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIRequirementStatus(), nullValue()); } @Override @@ -58,8 +57,8 @@ public void convertSDKToSDK() { sdkRequirementStatus1 = com.silanis.esl.sdk.RequirementStatus.INCOMPLETE; sdkRequirementStatus2 = new RequirementStatusConverter(sdkRequirementStatus1).toSDKRequirementStatus(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkRequirementStatus2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkRequirementStatus2, is(equalTo(sdkRequirementStatus1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkRequirementStatus2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkRequirementStatus2, is(sdkRequirementStatus1)); } @Override @@ -68,8 +67,8 @@ public void convertAPIToAPI() { apiRequirementStatus1 = "REJECTED"; apiRequirementStatus2 = new RequirementStatusConverter(apiRequirementStatus1).toAPIRequirementStatus(); - assertThat("Converter returned a null api object for a non null api object", apiRequirementStatus2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiRequirementStatus2, is(equalTo(apiRequirementStatus1))); + assertThat("Converter returned a null api object for a non null api object", apiRequirementStatus2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiRequirementStatus2, is(apiRequirementStatus1)); } @Override diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderConverterTest.java index 4efbc2ebb..db2b90b31 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderConverterTest.java @@ -1,23 +1,21 @@ package com.silanis.esl.sdk.internal.converter; import com.silanis.esl.api.model.External; -import org.hamcrest.Matchers; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * User: jessica * Date: 03/12/13 * Time: 9:39 AM - * + *

* Test SenderConverter. */ -public class SenderConverterTest implements ConverterTest{ +public class SenderConverterTest implements ConverterTest { private com.silanis.esl.sdk.SenderInfo sdkSenderInfo1 = null; private com.silanis.esl.sdk.SenderInfo sdkSenderInfo2 = null; private com.silanis.esl.sdk.Sender sdkSender = null; @@ -30,7 +28,7 @@ public class SenderConverterTest implements ConverterTest{ public void convertNullSDKToAPI() { sdkSenderInfo1 = null; converter = new SenderConverter(sdkSenderInfo1); - assertThat( "Converter didn't return a null api object for a null sdk object", converter.toAPISender(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISender(), nullValue()); } @Override @@ -38,7 +36,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiSender1 = null; converter = new SenderConverter(apiSender1); - assertThat( "Converter didn't return a null sdk object for a null api object", converter.toSDKSenderInfo(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSenderInfo(), nullValue()); } @Override @@ -46,7 +44,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkSenderInfo1 = null; converter = new SenderConverter(sdkSenderInfo1); - assertThat( "Converter didn't return a null sdk object for a null sdk object", converter.toSDKSenderInfo(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSenderInfo(), nullValue()); } @Override @@ -54,7 +52,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiSender1 = null; converter = new SenderConverter(apiSender1); - assertThat( "Converter didn't return a null api object for a null api object", converter.toAPISender(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPISender(), nullValue()); } @Override @@ -63,8 +61,8 @@ public void convertSDKToSDK() { sdkSenderInfo1 = createTypicalSDKSender(); sdkSenderInfo2 = new SenderConverter(sdkSenderInfo1).toSDKSenderInfo(); - assertThat( "Converter returned a null sdk object for a non null sdk object", sdkSenderInfo2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null sdk object it was given", sdkSenderInfo2, is( equalTo(sdkSenderInfo1) ) ); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkSenderInfo2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkSenderInfo2, is(sdkSenderInfo1)); } @Override @@ -74,8 +72,8 @@ public void convertAPIToAPI() { apiSender1 = createTypicalAPISender(); apiSender2 = new SenderConverter(apiSender1).toAPISender(); - assertThat( "Converter returned a null api object for a non null api object", apiSender2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null api object it was given", apiSender2, is( equalTo( apiSender1 ) ) ); + assertThat("Converter returned a null api object for a non null api object", apiSender2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiSender2, is(apiSender1)); } @Override @@ -84,12 +82,12 @@ public void convertAPIToSDK() { apiSender1 = createTypicalAPISender(); sdkSenderInfo1 = new SenderConverter(apiSender1).toSDKSenderInfo(); - assertThat("Converter returned a null api object for a non null sdk object", apiSender1, is(notNullValue())); - assertThat("first name was not properly set or retrieved", apiSender1.getFirstName(), Matchers.is(Matchers.equalTo(sdkSenderInfo1.getFirstName()))); - assertThat( "last name was not properly set or retrieved", apiSender1.getLastName(), Matchers.is(Matchers.equalTo(sdkSenderInfo1.getLastName()))); - assertThat( "company was not properly set or retrieved", apiSender1.getCompany(), Matchers.is(Matchers.equalTo(sdkSenderInfo1.getCompany()))); - assertThat( "title was not properly set or retrieved", apiSender1.getTitle(), Matchers.is(Matchers.equalTo(sdkSenderInfo1.getTitle()))); - assertThat( "timezone id was not properly set or retrieved", apiSender1.getTimezoneId(), Matchers.is(Matchers.equalTo(sdkSenderInfo1.getTimezoneId()))); + assertThat("Converter returned a null api object for a non null sdk object", apiSender1, notNullValue()); + assertThat("first name was not properly set or retrieved", apiSender1.getFirstName(), is(sdkSenderInfo1.getFirstName())); + assertThat("last name was not properly set or retrieved", apiSender1.getLastName(), is(sdkSenderInfo1.getLastName())); + assertThat("company was not properly set or retrieved", apiSender1.getCompany(), is(sdkSenderInfo1.getCompany())); + assertThat("title was not properly set or retrieved", apiSender1.getTitle(), is(sdkSenderInfo1.getTitle())); + assertThat("timezone id was not properly set or retrieved", apiSender1.getTimezoneId(), is(sdkSenderInfo1.getTimezoneId())); } @Override @@ -99,12 +97,12 @@ public void convertSDKToAPI() { sdkSenderInfo1 = createTypicalSDKSender(); apiSender1 = new SenderConverter(sdkSenderInfo1).toAPISender(); - assertThat("Converter returned a null api object for a non null sdk object", apiSender1, is( notNullValue() ) ); - assertThat("first name was not properly set or retrieved", apiSender1.getFirstName(), Matchers.is(Matchers.equalTo(sdkSenderInfo1.getFirstName()))); - assertThat( "last name was not properly set or retrieved", apiSender1.getLastName(), Matchers.is(Matchers.equalTo(sdkSenderInfo1.getLastName()))); - assertThat( "company was not properly set or retrieved", apiSender1.getCompany(), Matchers.is(Matchers.equalTo(sdkSenderInfo1.getCompany()))); - assertThat( "title was not properly set or retrieved", apiSender1.getTitle(), Matchers.is(Matchers.equalTo(sdkSenderInfo1.getTitle()))); - assertThat( "timezone id was not properly set or retrieved", apiSender1.getTimezoneId(), Matchers.is(Matchers.equalTo(sdkSenderInfo1.getTimezoneId()))); + assertThat("Converter returned a null api object for a non null sdk object", apiSender1, notNullValue()); + assertThat("first name was not properly set or retrieved", apiSender1.getFirstName(), is(sdkSenderInfo1.getFirstName())); + assertThat("last name was not properly set or retrieved", apiSender1.getLastName(), is(sdkSenderInfo1.getLastName())); + assertThat("company was not properly set or retrieved", apiSender1.getCompany(), is(sdkSenderInfo1.getCompany())); + assertThat("title was not properly set or retrieved", apiSender1.getTitle(), is(sdkSenderInfo1.getTitle())); + assertThat("timezone id was not properly set or retrieved", apiSender1.getTimezoneId(), is(sdkSenderInfo1.getTimezoneId())); } @Test @@ -112,7 +110,7 @@ public void convertAPIToSDKSender() { apiSender1 = createTypicalAPISender(); sdkSender = new SenderConverter(apiSender1).toSDKSender(); - assertThat("Sender status is incorrect.", sdkSender.getStatus().toString(), is(apiSender1.getStatus().toString())); + assertThat("Sender status is incorrect.", sdkSender.getStatus().toString(), is(apiSender1.getStatus())); assertThat("Sender last name is incorrect.", sdkSender.getLastName(), is(apiSender1.getLastName())); assertThat("Sender first name is incorrect.", sdkSender.getFirstName(), is(apiSender1.getFirstName())); assertThat("Sender company is incorrect.", sdkSender.getCompany(), is(apiSender1.getCompany())); @@ -122,7 +120,7 @@ public void convertAPIToSDKSender() { assertThat("Sender phone number is incorrect.", sdkSender.getPhone(), is(apiSender1.getPhone())); assertThat("Sender name is incorrect.", sdkSender.getName(), is(apiSender1.getName())); assertThat("Sender title is incorrect.", sdkSender.getTitle(), is(apiSender1.getTitle())); - assertThat("Sender type is incorrect.", sdkSender.getType().toString(), is(apiSender1.getType().toString())); + assertThat("Sender type is incorrect.", sdkSender.getType().toString(), is(apiSender1.getType())); assertThat("Sender updated date is incorrect.", sdkSender.getUpdated(), is(apiSender1.getUpdated())); assertThat("Sender id is incorrect.", sdkSender.getId(), is(apiSender1.getId())); assertThat("Sender external id is incorrect.", sdkSender.getExternal().getId(), is(apiSender1.getExternal().getId())); @@ -139,11 +137,11 @@ public void convertAPIToSDKSender() { private com.silanis.esl.sdk.SenderInfo createTypicalSDKSender() { com.silanis.esl.sdk.SenderInfo sdkSender = new com.silanis.esl.sdk.SenderInfo(); - sdkSender.setTitle( "title" ); - sdkSender.setCompany( "company" ); - sdkSender.setFirstName( "firstName" ); - sdkSender.setLastName( "lastName" ); - sdkSender.setTimezoneId( "Canada/Mountain" ); + sdkSender.setTitle("title"); + sdkSender.setCompany("company"); + sdkSender.setFirstName("firstName"); + sdkSender.setLastName("lastName"); + sdkSender.setTimezoneId("Canada/Mountain"); return sdkSender; } @@ -164,5 +162,5 @@ private com.silanis.esl.api.model.Sender createTypicalAPISender() { apiSender.setExternal(new External().setId("externalId").setProvider("provider").setProviderName("providerName")); return apiSender; - } + } } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderStatusConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderStatusConverterTest.java index f68d1152a..f1f1040c5 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderStatusConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderStatusConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by lena on 2014-05-30. @@ -25,7 +24,7 @@ public class SenderStatusConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkSenderStatus1 = null; converter = new SenderStatusConverter(sdkSenderStatus1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISenderStatus(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISenderStatus(), nullValue()); } @Override @@ -33,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiSenderStatus1 = null; converter = new SenderStatusConverter(apiSenderStatus1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSenderStatus(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSenderStatus(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkSenderStatus1 = null; converter = new SenderStatusConverter(sdkSenderStatus1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSenderStatus(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSenderStatus(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiSenderStatus1 = null; converter = new SenderStatusConverter(apiSenderStatus1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPISenderStatus(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPISenderStatus(), nullValue()); } @Override @@ -58,8 +57,8 @@ public void convertSDKToSDK() { sdkSenderStatus1 = com.silanis.esl.sdk.SenderStatus.INVITED; sdkSenderStatus2 = new SenderStatusConverter(sdkSenderStatus1).toSDKSenderStatus(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkSenderStatus2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkSenderStatus2, is(equalTo(sdkSenderStatus1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkSenderStatus2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkSenderStatus2, is(sdkSenderStatus1)); } @Override @@ -68,8 +67,8 @@ public void convertAPIToAPI() { apiSenderStatus1 = "LOCKED"; apiSenderStatus2 = new SenderStatusConverter(apiSenderStatus1).toAPISenderStatus(); - assertThat("Converter returned a null api object for a non null api object", apiSenderStatus2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiSenderStatus2, is(equalTo(apiSenderStatus1))); + assertThat("Converter returned a null api object for a non null api object", apiSenderStatus2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiSenderStatus2, is(apiSenderStatus1)); } @Override diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderTypeConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderTypeConverterTest.java index 954830a8a..0195f1a07 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderTypeConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SenderTypeConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by lena on 2014-05-30. @@ -25,7 +24,7 @@ public class SenderTypeConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkSenderType1 = null; converter = new SenderTypeConverter(sdkSenderType1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISenderType(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISenderType(), nullValue()); } @Override @@ -33,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiSenderType1 = null; converter = new SenderTypeConverter(apiSenderType1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSenderType(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSenderType(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkSenderType1 = null; converter = new SenderTypeConverter(sdkSenderType1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSenderType(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSenderType(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiSenderType1 = null; converter = new SenderTypeConverter(apiSenderType1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPISenderType(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPISenderType(), nullValue()); } @Override @@ -58,8 +57,8 @@ public void convertSDKToSDK() { sdkSenderType1 = com.silanis.esl.sdk.SenderType.MANAGER; sdkSenderType2 = new SenderTypeConverter(sdkSenderType1).toSDKSenderType(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkSenderType2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkSenderType2, is(equalTo(sdkSenderType1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkSenderType2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkSenderType2, is(sdkSenderType1)); } @Override @@ -68,8 +67,8 @@ public void convertAPIToAPI() { apiSenderType1 = "REGULAR"; apiSenderType2 = new SenderTypeConverter(apiSenderType1).toAPISenderType(); - assertThat("Converter returned a null api object for a non null api object", apiSenderType2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiSenderType2, is(equalTo(apiSenderType1))); + assertThat("Converter returned a null api object for a non null api object", apiSenderType2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiSenderType2, is(apiSenderType1)); } @Override diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignatureConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignatureConverterTest.java index 2084c62ad..f298278b8 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignatureConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignatureConverterTest.java @@ -24,7 +24,7 @@ public class SignatureConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkSignature1 = null; converter = new SignatureConverter(sdkSignature1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIApproval(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIApproval(), nullValue()); } @Override @@ -32,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiApproval1 = null; converter = new SignatureConverter(apiApproval1, apiPackage); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSignature(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSignature(), nullValue()); } @Override @@ -40,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkSignature1 = null; converter = new SignatureConverter(sdkSignature1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSignature(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSignature(), nullValue()); } @Override @@ -48,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiApproval1 = null; converter = new SignatureConverter(apiApproval1, apiPackage); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIApproval(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIApproval(), nullValue()); } @Override @@ -57,8 +57,8 @@ public void convertSDKToSDK() { sdkSignature1 = createTypicalSDKSignature(); sdkSignature2 = new SignatureConverter(sdkSignature1).toSDKSignature(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkSignature2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkSignature2, is(equalTo(sdkSignature1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkSignature2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkSignature2, is(sdkSignature1)); } @Override @@ -68,7 +68,7 @@ public void convertAPIToAPI() { apiApproval1 = createTypicalAPIApproval(); apiApproval2 = new SignatureConverter(apiApproval1, apiPackage).toAPIApproval(); - assertThat("Converter returned a null api object for a non null api object", apiApproval2, is(notNullValue())); + assertThat("Converter returned a null api object for a non null api object", apiApproval2, notNullValue()); assertThat("Converter didn't return the same non-null api object it was given", apiApproval2, is(apiApproval1)); } @@ -85,14 +85,14 @@ public void convertSDKToAPI() { sdkSignature1 = createTypicalSDKSignature(); apiApproval1 = new SignatureConverter(sdkSignature1).toAPIApproval(); - assertThat("Converter returned a null api object for a non null sdk object", apiApproval1, is(notNullValue())); + assertThat("Converter returned a null api object for a non null sdk object", apiApproval1, notNullValue()); assertTrue("EnforceCaptureSignature was not correctly set", apiApproval1.getEnforceCaptureSignature()); - assertThat("Name was not correctly set", apiApproval1.getFields().get(0).getName(), is(equalTo(sdkSignature1.getName().toString()))); - assertThat("Height was not correctly set", apiApproval1.getFields().get(0).getHeight(), is(equalTo(sdkSignature1.getHeight()))); - assertThat("Width was not correctly set", apiApproval1.getFields().get(0).getWidth(), is(equalTo(sdkSignature1.getWidth()))); - assertThat("Page was not correctly set", apiApproval1.getFields().get(0).getPage(), is(equalTo(sdkSignature1.getPage()))); - assertThat("Left position was not correctly set", apiApproval1.getFields().get(0).getLeft(), is(equalTo(sdkSignature1.getX()))); - assertThat("Top position was not correctly set", apiApproval1.getFields().get(0).getTop(), is(equalTo(sdkSignature1.getY()))); + assertThat("Name was not correctly set", apiApproval1.getFields().get(0).getName(), is(sdkSignature1.getName())); + assertThat("Height was not correctly set", apiApproval1.getFields().get(0).getHeight(), is(sdkSignature1.getHeight())); + assertThat("Width was not correctly set", apiApproval1.getFields().get(0).getWidth(), is(sdkSignature1.getWidth())); + assertThat("Page was not correctly set", apiApproval1.getFields().get(0).getPage(), is(sdkSignature1.getPage())); + assertThat("Left position was not correctly set", apiApproval1.getFields().get(0).getLeft(), is(sdkSignature1.getX())); + assertThat("Top position was not correctly set", apiApproval1.getFields().get(0).getTop(), is(sdkSignature1.getY())); } private Signature createTypicalSDKSignature() { diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerConverterTest.java index 72fbb4820..753ddc7b5 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerConverterTest.java @@ -1,9 +1,11 @@ package com.silanis.esl.sdk.internal.converter; -import com.silanis.esl.api.model.*; +import com.silanis.esl.api.model.AttachmentRequirement; +import com.silanis.esl.api.model.BaseMessage; +import com.silanis.esl.api.model.Delivery; +import com.silanis.esl.api.model.Signer; import com.silanis.esl.sdk.builder.AttachmentRequirementBuilder; import com.silanis.esl.sdk.builder.SignerBuilder; -import org.hamcrest.Matchers; import org.junit.Test; import java.util.ArrayList; @@ -12,11 +14,9 @@ import java.util.UUID; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * User: jessica @@ -111,7 +111,7 @@ public void convertAPIToSDK() { assertThat("Attachment's name was not set correctly", attachmentName, is(sdkSigner1.getAttachmentRequirement(attachmentName).getName())); assertThat("Attachment's description was not set correctly", apiRole.getAttachmentRequirements().get(0).getDescription(), is(sdkSigner1.getAttachmentRequirement(attachmentName).getDescription())); assertThat("Attachment's required property was not set correctly", apiRole.getAttachmentRequirements().get(0).getRequired(), is(sdkSigner1.getAttachmentRequirement(attachmentName).isRequired())); - assertThat("Attachment's status was not set correctly", apiRole.getAttachmentRequirements().get(0).getStatus().toString(), is(sdkSigner1.getAttachmentRequirement(attachmentName).getStatus().toString())); + assertThat("Attachment's status was not set correctly", apiRole.getAttachmentRequirements().get(0).getStatus(), is(sdkSigner1.getAttachmentRequirement(attachmentName).getStatus().toString())); assertThat("Attachment's comments was not set correctly", apiRole.getAttachmentRequirements().get(0).getComment(), is(sdkSigner1.getAttachmentRequirement(attachmentName).getSenderComment())); } @@ -151,8 +151,8 @@ public void convertSDKSignerToAPIRole() { assertThat("Language was not correctly set", apiRole.getSigners().get(0).getLanguage(), is(sdkSigner1.getLanguage().getLanguage())); - assertThat("ID was not set correctly", apiRole.getId().toString(), is(sdkSigner1.getId())); - assertThat("Name was not set correctly", apiRole.getName().toString(), is(sdkSigner1.getId())); + assertThat("ID was not set correctly", apiRole.getId(), is(sdkSigner1.getId())); + assertThat("Name was not set correctly", apiRole.getName(), is(sdkSigner1.getId())); assertThat("Message was not set correctly", apiRole.getEmailMessage().getContent(), is(sdkSigner1.getMessage())); String attachmentName = apiRole.getAttachmentRequirements().get(0).getName(); @@ -191,8 +191,8 @@ public void convertSDKSignerWithNullEntriesToAPIRole() { assertThat("Language was not correctly set", apiRole.getSigners().get(0).getLanguage(), is(sdkSigner1.getLanguage().getLanguage())); - assertThat("ID was not set correctly", apiRole.getId().toString(), is(roleId)); - assertThat("Name was not set correctly", apiRole.getName().toString(), is(roleId)); + assertThat("ID was not set correctly", apiRole.getId(), is(roleId)); + assertThat("Name was not set correctly", apiRole.getName(), is(roleId)); assertThat("Message was not set correctly", apiRole.getEmailMessage(), nullValue()); } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerInformationForEquifaxCanadaConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerInformationForEquifaxCanadaConverterTest.java index bf6b3e491..964604ee6 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerInformationForEquifaxCanadaConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerInformationForEquifaxCanadaConverterTest.java @@ -20,28 +20,28 @@ public class SignerInformationForEquifaxCanadaConverterTest implements Converter public void convertNullSDKToAPI() { sdkSignerInformationCanada = null; converter = new SignerInformationForEquifaxCanadaConverter(sdkSignerInformationCanada); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISignerInformationForEquifaxCanada(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISignerInformationForEquifaxCanada(), nullValue()); } @Test public void convertNullAPIToSDK() { apiSignerInformationCanada = null; converter = new SignerInformationForEquifaxCanadaConverter(apiSignerInformationCanada); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSignerInformationForEquifaxCanada(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSignerInformationForEquifaxCanada(), nullValue()); } @Test public void convertNullSDKToSDK() { sdkSignerInformationCanada = null; converter = new SignerInformationForEquifaxCanadaConverter(sdkSignerInformationCanada); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSignerInformationForEquifaxCanada(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSignerInformationForEquifaxCanada(), nullValue()); } @Test public void convertNullAPIToAPI() { apiSignerInformationCanada = null; converter = new SignerInformationForEquifaxCanadaConverter(apiSignerInformationCanada); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPISignerInformationForEquifaxCanada(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPISignerInformationForEquifaxCanada(), nullValue()); } @Test @@ -49,8 +49,8 @@ public void convertSDKToSDK() { sdkSignerInformationCanada = new SignerInformationForEquifaxCanada(); converter = new SignerInformationForEquifaxCanadaConverter(sdkSignerInformationCanada); SignerInformationForEquifaxCanada result = converter.toSDKSignerInformationForEquifaxCanada(); - assertThat("Converter returned a null sdk object for a non null sdk object", result, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", result, is(equalTo(sdkSignerInformationCanada))); + assertThat("Converter returned a null sdk object for a non null sdk object", result, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", result, is(sdkSignerInformationCanada)); } @Test @@ -58,8 +58,8 @@ public void convertAPIToAPI() { apiSignerInformationCanada = new com.silanis.esl.api.model.SignerInformationForEquifaxCanada(); converter = new SignerInformationForEquifaxCanadaConverter(apiSignerInformationCanada); com.silanis.esl.api.model.SignerInformationForEquifaxCanada result = converter.toAPISignerInformationForEquifaxCanada(); - assertThat("Converter returned a null api object for a non null api object", result, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", result, is(equalTo(apiSignerInformationCanada))); + assertThat("Converter returned a null api object for a non null api object", result, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", result, is(apiSignerInformationCanada)); } @Test @@ -67,18 +67,18 @@ public void convertAPIToSDK() { apiSignerInformationCanada = createTypicalAPISignerInformationForEquifaxCanada(); sdkSignerInformationCanada = new SignerInformationForEquifaxCanadaConverter(apiSignerInformationCanada).toSDKSignerInformationForEquifaxCanada(); - assertThat("Converter returned a null api object for a non null sdk object", apiSignerInformationCanada, is(notNullValue())); - assertThat("First name was not properly set or retrieved", apiSignerInformationCanada.getFirstName(), is(equalTo(sdkSignerInformationCanada.getFirstName()))); - assertThat("Last name was not properly set or retrieved", apiSignerInformationCanada.getLastName(), is(equalTo(sdkSignerInformationCanada.getLastName()))); - assertThat("Address was not properly set or retrieved", apiSignerInformationCanada.getStreetAddress(), is(equalTo(sdkSignerInformationCanada.getStreetAddress()))); - assertThat("City was not properly set or retrieved", apiSignerInformationCanada.getCity(), is(equalTo(sdkSignerInformationCanada.getCity()))); - assertThat("Postal Code was not properly set or retrieved", apiSignerInformationCanada.getPostalCode(), is(equalTo(sdkSignerInformationCanada.getPostalCode()))); - assertThat("Province was not properly set or retrieved", apiSignerInformationCanada.getProvince(), is(equalTo(sdkSignerInformationCanada.getProvince()))); - assertThat("Time at address was not properly set or retrieved", apiSignerInformationCanada.getTimeAtAddress(), is(equalTo(sdkSignerInformationCanada.getTimeAtAddress()))); - assertThat("Date of birth was not properly set or retrieved", apiSignerInformationCanada.getDateOfBirth(), is(equalTo(sdkSignerInformationCanada.getDateOfBirth()))); - assertThat("Driver's license was not properly set or retrieved", apiSignerInformationCanada.getDriversLicenseNumber(), is(equalTo(sdkSignerInformationCanada.getDriversLicenseNumber()))); - assertThat("SIN number was not properly set or retrieved", apiSignerInformationCanada.getSocialInsuranceNumber(), is(equalTo(sdkSignerInformationCanada.getSocialInsuranceNumber()))); - assertThat("Home phone number was not properly set or retrieved", apiSignerInformationCanada.getHomePhoneNumber(), is(equalTo(sdkSignerInformationCanada.getHomePhoneNumber()))); + assertThat("Converter returned a null api object for a non null sdk object", apiSignerInformationCanada, notNullValue()); + assertThat("First name was not properly set or retrieved", apiSignerInformationCanada.getFirstName(), is(sdkSignerInformationCanada.getFirstName())); + assertThat("Last name was not properly set or retrieved", apiSignerInformationCanada.getLastName(), is(sdkSignerInformationCanada.getLastName())); + assertThat("Address was not properly set or retrieved", apiSignerInformationCanada.getStreetAddress(), is(sdkSignerInformationCanada.getStreetAddress())); + assertThat("City was not properly set or retrieved", apiSignerInformationCanada.getCity(), is(sdkSignerInformationCanada.getCity())); + assertThat("Postal Code was not properly set or retrieved", apiSignerInformationCanada.getPostalCode(), is(sdkSignerInformationCanada.getPostalCode())); + assertThat("Province was not properly set or retrieved", apiSignerInformationCanada.getProvince(), is(sdkSignerInformationCanada.getProvince())); + assertThat("Time at address was not properly set or retrieved", apiSignerInformationCanada.getTimeAtAddress(), is(sdkSignerInformationCanada.getTimeAtAddress())); + assertThat("Date of birth was not properly set or retrieved", apiSignerInformationCanada.getDateOfBirth(), is(sdkSignerInformationCanada.getDateOfBirth())); + assertThat("Driver's license was not properly set or retrieved", apiSignerInformationCanada.getDriversLicenseNumber(), is(sdkSignerInformationCanada.getDriversLicenseNumber())); + assertThat("SIN number was not properly set or retrieved", apiSignerInformationCanada.getSocialInsuranceNumber(), is(sdkSignerInformationCanada.getSocialInsuranceNumber())); + assertThat("Home phone number was not properly set or retrieved", apiSignerInformationCanada.getHomePhoneNumber(), is(sdkSignerInformationCanada.getHomePhoneNumber())); } @Test @@ -86,18 +86,18 @@ public void convertSDKToAPI() { sdkSignerInformationCanada = createTypicalSDKSignerInformationForEquifaxCanada(); apiSignerInformationCanada = new SignerInformationForEquifaxCanadaConverter(sdkSignerInformationCanada).toAPISignerInformationForEquifaxCanada(); - assertThat("Converter returned a null api object for a non null api object", sdkSignerInformationCanada, is(notNullValue())); - assertThat("First name was not properly set or retrieved", sdkSignerInformationCanada.getFirstName(), is(equalTo(apiSignerInformationCanada.getFirstName()))); - assertThat("Last name was not properly set or retrieved", sdkSignerInformationCanada.getLastName(), is(equalTo(apiSignerInformationCanada.getLastName()))); - assertThat("Address was not properly set or retrieved", sdkSignerInformationCanada.getStreetAddress(), is(equalTo(apiSignerInformationCanada.getStreetAddress()))); - assertThat("City was not properly set or retrieved", sdkSignerInformationCanada.getCity(), is(equalTo(apiSignerInformationCanada.getCity()))); - assertThat("Postal Code was not properly set or retrieved", sdkSignerInformationCanada.getPostalCode(), is(equalTo(apiSignerInformationCanada.getPostalCode()))); - assertThat("Province was not properly set or retrieved", sdkSignerInformationCanada.getProvince(), is(equalTo(apiSignerInformationCanada.getProvince()))); - assertThat("Time at address was not properly set or retrieved", sdkSignerInformationCanada.getTimeAtAddress(), is(equalTo(apiSignerInformationCanada.getTimeAtAddress()))); - assertThat("Date of birth was not properly set or retrieved", sdkSignerInformationCanada.getDateOfBirth(), is(equalTo(apiSignerInformationCanada.getDateOfBirth()))); - assertThat("Driver's license was not properly set or retrieved", sdkSignerInformationCanada.getDriversLicenseNumber(), is(equalTo(apiSignerInformationCanada.getDriversLicenseNumber()))); - assertThat("SIN number was not properly set or retrieved", sdkSignerInformationCanada.getSocialInsuranceNumber(), is(equalTo(apiSignerInformationCanada.getSocialInsuranceNumber()))); - assertThat("Home phone number was not properly set or retrieved", sdkSignerInformationCanada.getHomePhoneNumber(), is(equalTo(apiSignerInformationCanada.getHomePhoneNumber()))); + assertThat("Converter returned a null api object for a non null api object", sdkSignerInformationCanada, notNullValue()); + assertThat("First name was not properly set or retrieved", sdkSignerInformationCanada.getFirstName(), is(apiSignerInformationCanada.getFirstName())); + assertThat("Last name was not properly set or retrieved", sdkSignerInformationCanada.getLastName(), is(apiSignerInformationCanada.getLastName())); + assertThat("Address was not properly set or retrieved", sdkSignerInformationCanada.getStreetAddress(), is(apiSignerInformationCanada.getStreetAddress())); + assertThat("City was not properly set or retrieved", sdkSignerInformationCanada.getCity(), is(apiSignerInformationCanada.getCity())); + assertThat("Postal Code was not properly set or retrieved", sdkSignerInformationCanada.getPostalCode(), is(apiSignerInformationCanada.getPostalCode())); + assertThat("Province was not properly set or retrieved", sdkSignerInformationCanada.getProvince(), is(apiSignerInformationCanada.getProvince())); + assertThat("Time at address was not properly set or retrieved", sdkSignerInformationCanada.getTimeAtAddress(), is(apiSignerInformationCanada.getTimeAtAddress())); + assertThat("Date of birth was not properly set or retrieved", sdkSignerInformationCanada.getDateOfBirth(), is(apiSignerInformationCanada.getDateOfBirth())); + assertThat("Driver's license was not properly set or retrieved", sdkSignerInformationCanada.getDriversLicenseNumber(), is(apiSignerInformationCanada.getDriversLicenseNumber())); + assertThat("SIN number was not properly set or retrieved", sdkSignerInformationCanada.getSocialInsuranceNumber(), is(apiSignerInformationCanada.getSocialInsuranceNumber())); + assertThat("Home phone number was not properly set or retrieved", sdkSignerInformationCanada.getHomePhoneNumber(), is(apiSignerInformationCanada.getHomePhoneNumber())); } /** diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerInformationForEquifaxUSAConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerInformationForEquifaxUSAConverterTest.java index e436d60a9..cdd5ef226 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerInformationForEquifaxUSAConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SignerInformationForEquifaxUSAConverterTest.java @@ -20,28 +20,28 @@ public class SignerInformationForEquifaxUSAConverterTest implements ConverterTes public void convertNullSDKToAPI() { sdkSignerInformationUSA = null; converter = new SignerInformationForEquifaxUSAConverter(sdkSignerInformationUSA); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISignerInformationForEquifaxUSA(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISignerInformationForEquifaxUSA(), nullValue()); } @Test public void convertNullAPIToSDK() { apiSignerInformationUSA = null; converter = new SignerInformationForEquifaxUSAConverter(apiSignerInformationUSA); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSignerInformationForEquifaxUSA(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSignerInformationForEquifaxUSA(), nullValue()); } @Test public void convertNullSDKToSDK() { sdkSignerInformationUSA = null; converter = new SignerInformationForEquifaxUSAConverter(sdkSignerInformationUSA); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSignerInformationForEquifaxUSA(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSignerInformationForEquifaxUSA(), nullValue()); } @Test public void convertNullAPIToAPI() { apiSignerInformationUSA = null; converter = new SignerInformationForEquifaxUSAConverter(apiSignerInformationUSA); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPISignerInformationForEquifaxUSA(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPISignerInformationForEquifaxUSA(), nullValue()); } @Test @@ -49,8 +49,8 @@ public void convertSDKToSDK() { sdkSignerInformationUSA = new SignerInformationForEquifaxUSA(); converter = new SignerInformationForEquifaxUSAConverter(sdkSignerInformationUSA); SignerInformationForEquifaxUSA result = converter.toSDKSignerInformationForEquifaxUSA(); - assertThat("Converter returned a null sdk object for a non null sdk object", result, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", result, is(equalTo(sdkSignerInformationUSA))); + assertThat("Converter returned a null sdk object for a non null sdk object", result, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", result, is(sdkSignerInformationUSA)); } @Test @@ -58,8 +58,8 @@ public void convertAPIToAPI() { apiSignerInformationUSA = new com.silanis.esl.api.model.SignerInformationForEquifaxUSA(); converter = new SignerInformationForEquifaxUSAConverter(apiSignerInformationUSA); com.silanis.esl.api.model.SignerInformationForEquifaxUSA result = converter.toAPISignerInformationForEquifaxUSA(); - assertThat("Converter returned a null api object for a non null api object", result, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", result, is(equalTo(apiSignerInformationUSA))); + assertThat("Converter returned a null api object for a non null api object", result, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", result, is(apiSignerInformationUSA)); } @Test @@ -67,18 +67,18 @@ public void convertAPIToSDK() { apiSignerInformationUSA = createTypicalAPISignerInformationForEquifaxUSA(); sdkSignerInformationUSA = new SignerInformationForEquifaxUSAConverter(apiSignerInformationUSA).toSDKSignerInformationForEquifaxUSA(); - assertThat("Converter returned a null api object for a non null sdk object", apiSignerInformationUSA, is(notNullValue())); - assertThat("First name was not properly set or retrieved", apiSignerInformationUSA.getFirstName(), is(equalTo(sdkSignerInformationUSA.getFirstName()))); - assertThat("Last name was not properly set or retrieved", apiSignerInformationUSA.getLastName(), is(equalTo(sdkSignerInformationUSA.getLastName()))); - assertThat("Address was not properly set or retrieved", apiSignerInformationUSA.getStreetAddress(), is(equalTo(sdkSignerInformationUSA.getStreetAddress()))); - assertThat("City was not properly set or retrieved", apiSignerInformationUSA.getCity(), is(equalTo(sdkSignerInformationUSA.getCity()))); - assertThat("Zip Code was not properly set or retrieved", apiSignerInformationUSA.getZip(), is(equalTo(sdkSignerInformationUSA.getZip()))); - assertThat("State was not properly set or retrieved", apiSignerInformationUSA.getState(), is(equalTo(sdkSignerInformationUSA.getState()))); - assertThat("Time at address was not properly set or retrieved", apiSignerInformationUSA.getSocialSecurityNumber(), is(equalTo(sdkSignerInformationUSA.getSocialSecurityNumber()))); - assertThat("Date of birth was not properly set or retrieved", apiSignerInformationUSA.getDateOfBirth(), is(equalTo(sdkSignerInformationUSA.getDateOfBirth()))); - assertThat("Home phone number was not properly set or retrieved", apiSignerInformationUSA.getHomePhoneNumber(), is(equalTo(sdkSignerInformationUSA.getHomePhoneNumber()))); - assertThat("Driver's license was not properly set or retrieved", apiSignerInformationUSA.getDriversLicenseNumber(), is(equalTo(sdkSignerInformationUSA.getDriversLicenseNumber()))); - assertThat("Time at address was not properly set or retrieved", apiSignerInformationUSA.getTimeAtAddress(), is(equalTo(sdkSignerInformationUSA.getTimeAtAddress()))); + assertThat("Converter returned a null api object for a non null sdk object", apiSignerInformationUSA, notNullValue()); + assertThat("First name was not properly set or retrieved", apiSignerInformationUSA.getFirstName(), is(sdkSignerInformationUSA.getFirstName())); + assertThat("Last name was not properly set or retrieved", apiSignerInformationUSA.getLastName(), is(sdkSignerInformationUSA.getLastName())); + assertThat("Address was not properly set or retrieved", apiSignerInformationUSA.getStreetAddress(), is(sdkSignerInformationUSA.getStreetAddress())); + assertThat("City was not properly set or retrieved", apiSignerInformationUSA.getCity(), is(sdkSignerInformationUSA.getCity())); + assertThat("Zip Code was not properly set or retrieved", apiSignerInformationUSA.getZip(), is(sdkSignerInformationUSA.getZip())); + assertThat("State was not properly set or retrieved", apiSignerInformationUSA.getState(), is(sdkSignerInformationUSA.getState())); + assertThat("Time at address was not properly set or retrieved", apiSignerInformationUSA.getSocialSecurityNumber(), is(sdkSignerInformationUSA.getSocialSecurityNumber())); + assertThat("Date of birth was not properly set or retrieved", apiSignerInformationUSA.getDateOfBirth(), is(sdkSignerInformationUSA.getDateOfBirth())); + assertThat("Home phone number was not properly set or retrieved", apiSignerInformationUSA.getHomePhoneNumber(), is(sdkSignerInformationUSA.getHomePhoneNumber())); + assertThat("Driver's license was not properly set or retrieved", apiSignerInformationUSA.getDriversLicenseNumber(), is(sdkSignerInformationUSA.getDriversLicenseNumber())); + assertThat("Time at address was not properly set or retrieved", apiSignerInformationUSA.getTimeAtAddress(), is(sdkSignerInformationUSA.getTimeAtAddress())); } @Test @@ -86,18 +86,18 @@ public void convertSDKToAPI() { sdkSignerInformationUSA = createTypicalSDKSignerInformationForEquifaxUSA(); apiSignerInformationUSA = new SignerInformationForEquifaxUSAConverter(sdkSignerInformationUSA).toAPISignerInformationForEquifaxUSA(); - assertThat("Converter returned a null api object for a non null api object", sdkSignerInformationUSA, is(notNullValue())); - assertThat("First name was not properly set or retrieved", sdkSignerInformationUSA.getFirstName(), is(equalTo(apiSignerInformationUSA.getFirstName()))); - assertThat("Last name was not properly set or retrieved", sdkSignerInformationUSA.getLastName(), is(equalTo(apiSignerInformationUSA.getLastName()))); - assertThat("Address was not properly set or retrieved", sdkSignerInformationUSA.getStreetAddress(), is(equalTo(apiSignerInformationUSA.getStreetAddress()))); - assertThat("City was not properly set or retrieved", sdkSignerInformationUSA.getCity(), is(equalTo(apiSignerInformationUSA.getCity()))); - assertThat("Zip Code was not properly set or retrieved", sdkSignerInformationUSA.getZip(), is(equalTo(apiSignerInformationUSA.getZip()))); - assertThat("State was not properly set or retrieved", sdkSignerInformationUSA.getState(), is(equalTo(apiSignerInformationUSA.getState()))); - assertThat("Time at address was not properly set or retrieved", sdkSignerInformationUSA.getSocialSecurityNumber(), is(equalTo(apiSignerInformationUSA.getSocialSecurityNumber()))); - assertThat("Date of birth was not properly set or retrieved", sdkSignerInformationUSA.getDateOfBirth(), is(equalTo(apiSignerInformationUSA.getDateOfBirth()))); - assertThat("Home phone number was not properly set or retrieved", sdkSignerInformationUSA.getHomePhoneNumber(), is(equalTo(apiSignerInformationUSA.getHomePhoneNumber()))); - assertThat("Driver's license was not properly set or retrieved", sdkSignerInformationUSA.getDriversLicenseNumber(), is(equalTo(apiSignerInformationUSA.getDriversLicenseNumber()))); - assertThat("Time at address was not properly set or retrieved", sdkSignerInformationUSA.getTimeAtAddress(), is(equalTo(apiSignerInformationUSA.getTimeAtAddress()))); + assertThat("Converter returned a null api object for a non null api object", sdkSignerInformationUSA, notNullValue()); + assertThat("First name was not properly set or retrieved", sdkSignerInformationUSA.getFirstName(), is(apiSignerInformationUSA.getFirstName())); + assertThat("Last name was not properly set or retrieved", sdkSignerInformationUSA.getLastName(), is(apiSignerInformationUSA.getLastName())); + assertThat("Address was not properly set or retrieved", sdkSignerInformationUSA.getStreetAddress(), is(apiSignerInformationUSA.getStreetAddress())); + assertThat("City was not properly set or retrieved", sdkSignerInformationUSA.getCity(), is(apiSignerInformationUSA.getCity())); + assertThat("Zip Code was not properly set or retrieved", sdkSignerInformationUSA.getZip(), is(apiSignerInformationUSA.getZip())); + assertThat("State was not properly set or retrieved", sdkSignerInformationUSA.getState(), is(apiSignerInformationUSA.getState())); + assertThat("Time at address was not properly set or retrieved", sdkSignerInformationUSA.getSocialSecurityNumber(), is(apiSignerInformationUSA.getSocialSecurityNumber())); + assertThat("Date of birth was not properly set or retrieved", sdkSignerInformationUSA.getDateOfBirth(), is(apiSignerInformationUSA.getDateOfBirth())); + assertThat("Home phone number was not properly set or retrieved", sdkSignerInformationUSA.getHomePhoneNumber(), is(apiSignerInformationUSA.getHomePhoneNumber())); + assertThat("Driver's license was not properly set or retrieved", sdkSignerInformationUSA.getDriversLicenseNumber(), is(apiSignerInformationUSA.getDriversLicenseNumber())); + assertThat("Time at address was not properly set or retrieved", sdkSignerInformationUSA.getTimeAtAddress(), is(apiSignerInformationUSA.getTimeAtAddress())); } /** diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SupportConfigurationConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SupportConfigurationConverterTest.java index 521ef30ae..54e7473d6 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SupportConfigurationConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/SupportConfigurationConverterTest.java @@ -9,7 +9,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 7/14/16. @@ -25,7 +24,7 @@ public class SupportConfigurationConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkSupportConfiguration = null; converter = new SupportConfigurationConverter(sdkSupportConfiguration); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISupportConfiguration(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPISupportConfiguration(), nullValue()); } @Override @@ -33,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiSupportConfiguration = null; converter = new SupportConfigurationConverter(apiSupportConfiguration); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSupportConfiguration(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKSupportConfiguration(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkSupportConfiguration = null; converter = new SupportConfigurationConverter(sdkSupportConfiguration); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSupportConfiguration(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKSupportConfiguration(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiSupportConfiguration = null; converter = new SupportConfigurationConverter(apiSupportConfiguration); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPISupportConfiguration(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPISupportConfiguration(), nullValue()); } @Override @@ -58,8 +57,8 @@ public void convertSDKToSDK() { sdkSupportConfiguration = createTypicalSDKSupportConfiguration(); sdkSupportConfiguration = new SupportConfigurationConverter(sdkSupportConfiguration).toSDKSupportConfiguration(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkSupportConfiguration, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkSupportConfiguration, is(equalTo(sdkSupportConfiguration))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkSupportConfiguration, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkSupportConfiguration, is(sdkSupportConfiguration)); } @Override @@ -68,8 +67,8 @@ public void convertAPIToAPI() { apiSupportConfiguration = createTypicalAPISupportConfiguration(); apiSupportConfiguration = new SupportConfigurationConverter(apiSupportConfiguration).toAPISupportConfiguration(); - assertThat("Converter returned a null api object for a non null api object", apiSupportConfiguration, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiSupportConfiguration, is(equalTo(apiSupportConfiguration))); + assertThat("Converter returned a null api object for a non null api object", apiSupportConfiguration, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiSupportConfiguration, is(apiSupportConfiguration)); } @Override @@ -78,7 +77,7 @@ public void convertAPIToSDK() { apiSupportConfiguration = createTypicalAPISupportConfiguration(); sdkSupportConfiguration = new SupportConfigurationConverter(apiSupportConfiguration).toSDKSupportConfiguration(); - assertThat("Converter returned a null sdk object for a non null api object", sdkSupportConfiguration, is(notNullValue())); + assertThat("Converter returned a null sdk object for a non null api object", sdkSupportConfiguration, notNullValue()); assertThat("Email was not correctly set", sdkSupportConfiguration.getEmail(), is(apiSupportConfiguration.getEmail())); assertThat("Phone was not correctly set", sdkSupportConfiguration.getPhone(), is(apiSupportConfiguration.getPhone())); } @@ -89,7 +88,7 @@ public void convertSDKToAPI() { sdkSupportConfiguration = createTypicalSDKSupportConfiguration(); apiSupportConfiguration = new SupportConfigurationConverter(sdkSupportConfiguration).toAPISupportConfiguration(); - assertThat("Converter returned a null api object for a non null sdk object", apiSupportConfiguration, is(notNullValue())); + assertThat("Converter returned a null api object for a non null sdk object", apiSupportConfiguration, notNullValue()); assertThat("Email was not correctly set", apiSupportConfiguration.getEmail(), is(apiSupportConfiguration.getEmail())); assertThat("Phone was not correctly set", apiSupportConfiguration.getPhone(), is(apiSupportConfiguration.getPhone())); } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/TextAnchorConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/TextAnchorConverterTest.java index 18824b42c..c26039eea 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/TextAnchorConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/TextAnchorConverterTest.java @@ -15,7 +15,7 @@ * User: jessica * Date: 19/11/13 * Time: 4:44 PM - * + *

* Test TextAnchorConverter. */ public class TextAnchorConverterTest implements ConverterTest { @@ -31,7 +31,7 @@ public class TextAnchorConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkTextAnchor1 = null; TextAnchorConverter converter = new TextAnchorConverter(sdkTextAnchor1); - assertThat( "Converter didn't return a null api object for a null sdk object", converter.toAPIExtractAnchor(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIExtractAnchor(), is(nullValue())); } @Override @@ -39,7 +39,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiExtractAnchor1 = null; TextAnchorConverter converter = new TextAnchorConverter(apiExtractAnchor1); - assertThat( "Converter didn't return a null sdk object for a null api object", converter.toSDKTextAnchor(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKTextAnchor(), is(nullValue())); } @Override @@ -47,7 +47,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkTextAnchor1 = null; TextAnchorConverter converter = new TextAnchorConverter(sdkTextAnchor1); - assertThat( "Converter didn't return a null sdk object for a null sdk object", converter.toSDKTextAnchor(), is( nullValue() ) ); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKTextAnchor(), is(nullValue())); } @Override @@ -55,16 +55,16 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiExtractAnchor1 = null; TextAnchorConverter converter = new TextAnchorConverter(apiExtractAnchor1); - assertThat( "Converter didn't return a null api object for a null api object", converter.toAPIExtractAnchor(), is( nullValue() ) ); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIExtractAnchor(), is(nullValue())); } @Override @Test public void convertSDKToSDK() { - sdkTextAnchor1 = createTypicalSDKTextAnchor(); + sdkTextAnchor1 = createTypicalSDKTextAnchor(); sdkTextAnchor2 = new TextAnchorConverter(sdkTextAnchor1).toSDKTextAnchor(); - assertThat( "Converter returned a null sdk object for a non null sdk object", sdkTextAnchor2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null sdk object it was given", sdkTextAnchor2, is( equalTo( sdkTextAnchor1 ) ) ); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkTextAnchor2, is(notNullValue())); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkTextAnchor2, is(equalTo(sdkTextAnchor1))); } @Override @@ -72,17 +72,17 @@ public void convertSDKToSDK() { public void convertAPIToAPI() { apiExtractAnchor1 = createTypicalAPITextAnchor(); apiExtractAnchor2 = new TextAnchorConverter(apiExtractAnchor1).toAPIExtractAnchor(); - assertThat( "Converter returned a null api object for a non null api object", apiExtractAnchor2, is( notNullValue() ) ); - assertThat( "Converter didn't return the same non-null api object it was given", apiExtractAnchor2, is( equalTo( apiExtractAnchor1 ) ) ); + assertThat("Converter returned a null api object for a non null api object", apiExtractAnchor2, is(notNullValue())); + assertThat("Converter didn't return the same non-null api object it was given", apiExtractAnchor2, is(equalTo(apiExtractAnchor1))); } @Override @Test public void convertAPIToSDK() { - apiExtractAnchor1 = createTypicalAPITextAnchor(); + apiExtractAnchor1 = createTypicalAPITextAnchor(); sdkTextAnchor1 = new TextAnchorConverter(apiExtractAnchor1).toSDKTextAnchor(); - assertThat( "Converter returned a null sdk object for a non null api object", sdkTextAnchor1, is( notNullValue() ) ); - compareTextAnchors( sdkTextAnchor1, apiExtractAnchor1); + assertThat("Converter returned a null sdk object for a non null api object", sdkTextAnchor1, is(notNullValue())); + compareTextAnchors(sdkTextAnchor1, apiExtractAnchor1); } @Override @@ -91,9 +91,9 @@ public void convertSDKToAPI() { sdkTextAnchor1 = createTypicalSDKTextAnchor(); apiExtractAnchor1 = new TextAnchorConverter(sdkTextAnchor1).toAPIExtractAnchor(); - assertThat( "Converter returned a null api object for a non null sdk object", apiExtractAnchor1, is( notNullValue() ) ); + assertThat("Converter returned a null api object for a non null sdk object", apiExtractAnchor1, is(notNullValue())); - compareTextAnchors( sdkTextAnchor1, apiExtractAnchor1); + compareTextAnchors(sdkTextAnchor1, apiExtractAnchor1); } /** @@ -143,13 +143,13 @@ private com.silanis.esl.api.model.ExtractAnchor createTypicalAPITextAnchor() { } private void compareTextAnchors(com.silanis.esl.sdk.TextAnchor sdkTextAnchor, com.silanis.esl.api.model.ExtractAnchor apiExtractAnchor) { - assertThat( "Character index was not set correctly", apiExtractAnchor.getCharacterIndex(), is( equalTo( sdkTextAnchor.getCharacter()) ) ); - assertThat( " Height was not set correctly.", apiExtractAnchor.getHeight(), is( equalTo( sdkTextAnchor.getHeight() ) ) ); - assertThat( " Top offset was not set correctly.", apiExtractAnchor.getTopOffset(), is(equalTo(sdkTextAnchor.getYOffset())) ); - assertThat( " Left offset was not set correctly.", apiExtractAnchor.getLeftOffset(), is( equalTo( sdkTextAnchor.getXOffset() ) ) ); - assertThat( " Width was not set correctly.", apiExtractAnchor.getWidth(), is(equalTo(sdkTextAnchor.getWidth())) ); - assertThat( " Text was not set correctly.", apiExtractAnchor.getText(), is( equalTo( sdkTextAnchor.getAnchorText() ) ) ); - assertThat( " Anchor point was not set correctly.", apiExtractAnchor.getAnchorPoint(), is( equalTo( sdkTextAnchor.getPosition().toString() ) ) ); + assertThat("Character index was not set correctly", apiExtractAnchor.getCharacterIndex(), is(equalTo(sdkTextAnchor.getCharacter()))); + assertThat(" Height was not set correctly.", apiExtractAnchor.getHeight(), is(equalTo(sdkTextAnchor.getHeight()))); + assertThat(" Top offset was not set correctly.", apiExtractAnchor.getTopOffset(), is(sdkTextAnchor.getYOffset())); + assertThat(" Left offset was not set correctly.", apiExtractAnchor.getLeftOffset(), is(equalTo(sdkTextAnchor.getXOffset()))); + assertThat(" Width was not set correctly.", apiExtractAnchor.getWidth(), is(sdkTextAnchor.getWidth())); + assertThat(" Text was not set correctly.", apiExtractAnchor.getText(), is(equalTo(sdkTextAnchor.getAnchorText()))); + assertThat(" Anchor point was not set correctly.", apiExtractAnchor.getAnchorPoint(), is(equalTo(sdkTextAnchor.getPosition().toString()))); } } diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/UsageReportConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/UsageReportConverterTest.java index 961d51cd0..e0fe85c60 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/UsageReportConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/UsageReportConverterTest.java @@ -3,7 +3,12 @@ import com.silanis.esl.sdk.UsageReportCategory; import org.junit.Test; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; @@ -29,7 +34,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiUsageReport1 = null; converter = new UsageReportConverter(apiUsageReport1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKUsageReport(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKUsageReport(), nullValue()); } @Override diff --git a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/VisibilityConverterTest.java b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/VisibilityConverterTest.java index 65c99e86c..4797945b6 100644 --- a/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/VisibilityConverterTest.java +++ b/sdk/src/test/java/com/silanis/esl/sdk/internal/converter/VisibilityConverterTest.java @@ -7,7 +7,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; /** * Created by schoi on 2/20/15. @@ -25,7 +24,7 @@ public class VisibilityConverterTest implements ConverterTest { public void convertNullSDKToAPI() { sdkVisibility1 = null; converter = new VisibilityConverter(sdkVisibility1); - assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIVisibility(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null sdk object", converter.toAPIVisibility(), nullValue()); } @Override @@ -33,7 +32,7 @@ public void convertNullSDKToAPI() { public void convertNullAPIToSDK() { apiVisibility1 = null; converter = new VisibilityConverter(apiVisibility1); - assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKVisibility(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null api object", converter.toSDKVisibility(), nullValue()); } @Override @@ -41,7 +40,7 @@ public void convertNullAPIToSDK() { public void convertNullSDKToSDK() { sdkVisibility1 = null; converter = new VisibilityConverter(sdkVisibility1); - assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKVisibility(), is(nullValue())); + assertThat("Converter didn't return a null sdk object for a null sdk object", converter.toSDKVisibility(), nullValue()); } @Override @@ -49,7 +48,7 @@ public void convertNullSDKToSDK() { public void convertNullAPIToAPI() { apiVisibility1 = null; converter = new VisibilityConverter(apiVisibility1); - assertThat("Converter didn't return a null api object for a null api object", converter.toAPIVisibility(), is(nullValue())); + assertThat("Converter didn't return a null api object for a null api object", converter.toAPIVisibility(), nullValue()); } @Override @@ -58,8 +57,8 @@ public void convertSDKToSDK() { sdkVisibility1 = com.silanis.esl.sdk.Visibility.ACCOUNT; sdkVisibility2 = new VisibilityConverter(sdkVisibility1).toSDKVisibility(); - assertThat("Converter returned a null sdk object for a non null sdk object", sdkVisibility2, is(notNullValue())); - assertThat("Converter didn't return the same non-null sdk object it was given", sdkVisibility2, is(equalTo(sdkVisibility1))); + assertThat("Converter returned a null sdk object for a non null sdk object", sdkVisibility2, notNullValue()); + assertThat("Converter didn't return the same non-null sdk object it was given", sdkVisibility2, is(sdkVisibility1)); } @Override @@ -68,8 +67,8 @@ public void convertAPIToAPI() { apiVisibility1 = "REGULAR"; apiVisibility2 = new VisibilityConverter(apiVisibility1).toAPIVisibility(); - assertThat("Converter returned a null api object for a non null api object", apiVisibility2, is(notNullValue())); - assertThat("Converter didn't return the same non-null api object it was given", apiVisibility2, is(equalTo(apiVisibility1))); + assertThat("Converter returned a null api object for a non null api object", apiVisibility2, notNullValue()); + assertThat("Converter didn't return the same non-null api object it was given", apiVisibility2, is(apiVisibility1)); } @Override diff --git a/tester/src/test/java/com/silanis/esl/sdk/examples/ConditionalFieldExampleTest.java b/tester/src/test/java/com/silanis/esl/sdk/examples/ConditionalFieldExampleTest.java index dd598086b..405b12d6d 100644 --- a/tester/src/test/java/com/silanis/esl/sdk/examples/ConditionalFieldExampleTest.java +++ b/tester/src/test/java/com/silanis/esl/sdk/examples/ConditionalFieldExampleTest.java @@ -1,11 +1,9 @@ package com.silanis.esl.sdk.examples; import org.junit.Test; + import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.empty; -import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.*; public class ConditionalFieldExampleTest { @@ -18,7 +16,7 @@ public void verifyResult() { assertThat("Package doesn't have conditional fields.", example.retrievedPackageWithUpdatedConditions.getConditions(), hasSize(1)); assertThat("Package doesn't updated properly.", example.retrievedPackageWithUpdatedConditions.getConditions().get(0).getAction(), - is(equalTo("document['DocumentId'].field['fieldId1'].enabled = false"))); + is("document['DocumentId'].field['fieldId1'].enabled = false")); assertThat("Package have conditional fields.", example.retrievedPackageWithoutConditions.getConditions(), empty()); } diff --git a/tester/src/test/java/com/silanis/esl/sdk/examples/DocumentExtractionExampleTest.java b/tester/src/test/java/com/silanis/esl/sdk/examples/DocumentExtractionExampleTest.java index 9d020dedb..d34a808c2 100644 --- a/tester/src/test/java/com/silanis/esl/sdk/examples/DocumentExtractionExampleTest.java +++ b/tester/src/test/java/com/silanis/esl/sdk/examples/DocumentExtractionExampleTest.java @@ -1,6 +1,11 @@ package com.silanis.esl.sdk.examples; -import com.silanis.esl.sdk.*; +import com.silanis.esl.sdk.Document; +import com.silanis.esl.sdk.DocumentPackage; +import com.silanis.esl.sdk.Field; +import com.silanis.esl.sdk.FieldStyle; +import com.silanis.esl.sdk.Signature; +import com.silanis.esl.sdk.SignatureStyle; import org.apache.commons.lang3.ObjectUtils; import org.junit.Test; @@ -19,9 +24,8 @@ * User: jessica * Date: 10/01/14 * Time: 3:15 PM - * + *

* Test DocumentExtractionExample. - * */ public class DocumentExtractionExampleTest { @@ -92,7 +96,7 @@ private Signature signatureForTopLeft(List signatures, double top, do if (signatures != null) { for (Signature signature : signatures) { if (areClose(signature.getX(), left) && - areClose(signature.getY(), top)) { + areClose(signature.getY(), top)) { return signature; } } @@ -152,11 +156,9 @@ private void assertSignature(Signature signature, int numbOfFields) { assertThat("Wrong number of fields for signature.", signature.getFields().size(), is(numbOfFields)); } - private ArrayList convertList(Collection collection){ + private ArrayList convertList(Collection collection) { ArrayList list = new ArrayList(); - for (T type : collection){ - list.add(type); - } + list.addAll(collection); return list; } } diff --git a/tester/src/test/java/com/silanis/esl/sdk/examples/EventNotificationRegistrationExampleTest.java b/tester/src/test/java/com/silanis/esl/sdk/examples/EventNotificationRegistrationExampleTest.java index 50f8c5bab..bf9f93d81 100644 --- a/tester/src/test/java/com/silanis/esl/sdk/examples/EventNotificationRegistrationExampleTest.java +++ b/tester/src/test/java/com/silanis/esl/sdk/examples/EventNotificationRegistrationExampleTest.java @@ -27,7 +27,7 @@ public void verifyResult() { EventNotificationConfig config = example.config; - assertThat("EventNotificationConfig is null", config, is(notNullValue())); + assertThat("EventNotificationConfig is null", config, notNullValue()); assertThat("EventNotificationConfig's url is not set correctly", config.getUrl(), is(URL)); assertThat("EventNotificationConfig's key is not set correctly", config.getKey(), is(KEY)); assertThat("EventNotificationConfig should have 18 events", config.getEvents().size(), is(20)); @@ -36,7 +36,7 @@ public void verifyResult() { EventNotificationConfig connectorsConfig = example.connectorsConfig; - assertThat("EventNotificationConfig is null", connectorsConfig, is(notNullValue())); + assertThat("EventNotificationConfig is null", connectorsConfig, notNullValue()); assertThat("EventNotificationConfig's url is not set correctly", connectorsConfig.getUrl(), is(CONNECTORS_URL)); assertThat("EventNotificationConfig's key is not set correctly", connectorsConfig.getKey(), is(CONNECTORS_KEY)); assertThat("EventNotificationConfig should have 18 events", connectorsConfig.getEvents().size(), is(9)); diff --git a/tester/src/test/java/com/silanis/esl/sdk/examples/SenderManipulationExampleTest.java b/tester/src/test/java/com/silanis/esl/sdk/examples/SenderManipulationExampleTest.java index 35725e762..c512b9575 100644 --- a/tester/src/test/java/com/silanis/esl/sdk/examples/SenderManipulationExampleTest.java +++ b/tester/src/test/java/com/silanis/esl/sdk/examples/SenderManipulationExampleTest.java @@ -25,7 +25,7 @@ public void verifyResult() { // Invite three senders assertThat("Sender1's email was not set correctly.", example.retrievedSender1.getEmail(), is(example.email1)); - assertThat("Sender1's timezone id was not set correctly.", example.retrievedSender1.getTimezoneId(), is(equalTo("GMT"))); + assertThat("Sender1's timezone id was not set correctly.", example.retrievedSender1.getTimezoneId(), is("GMT")); assertThat("Sender2's email was not set correctly.", example.retrievedSender2.getEmail(), is(example.email2)); assertThat("Sender3's email was not set correctly.", example.retrievedSender3.getEmail(), is(example.email3)); diff --git a/tester/src/test/java/com/silanis/esl/sdk/examples/TemplateExampleTest.java b/tester/src/test/java/com/silanis/esl/sdk/examples/TemplateExampleTest.java index 7dcb13747..9632bc7a1 100644 --- a/tester/src/test/java/com/silanis/esl/sdk/examples/TemplateExampleTest.java +++ b/tester/src/test/java/com/silanis/esl/sdk/examples/TemplateExampleTest.java @@ -22,9 +22,9 @@ public void verifyResult() { DocumentPackage retrievedPackage = example.getRetrievedTemplate(); - Document document = retrievedPackage.getDocument( DOCUMENT_NAME ); + Document document = retrievedPackage.getDocument(DOCUMENT_NAME); - assertThat("Document name is incorrectly returned.", document.getName().toString(), is(DOCUMENT_NAME)); + assertThat("Document name is incorrectly returned.", document.getName(), is(DOCUMENT_NAME)); assertThat("Document ID is incorrectly returned.", document.getId().toString(), is(DOCUMENT_ID)); assertThat("Template name is incorrectly returned.", retrievedPackage.getName(), is(UPDATED_TEMPLATE_NAME));