Skip to content

Commit 9cd130e

Browse files
committed
NA: Consolidate remaining tests in GetSessionResultCheckTest
1 parent 8c2a1bc commit 9cd130e

File tree

1 file changed

+34
-126
lines changed

1 file changed

+34
-126
lines changed

yoti-sdk-api/src/test/java/com/yoti/api/client/docs/session/retrieve/GetSessionResultCheckTest.java

Lines changed: 34 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import com.yoti.api.client.spi.remote.util.FieldSetter;
1010

11-
import org.junit.Before;
1211
import org.junit.Test;
1312
import org.junit.runner.RunWith;
1413
import org.mockito.Mock;
@@ -17,6 +16,8 @@
1716
@RunWith(MockitoJUnitRunner.class)
1817
public class GetSessionResultCheckTest {
1918

19+
GetSessionResult testObj = new GetSessionResult();
20+
2021
@Mock AuthenticityCheckResponse authenticityCheckResponse;
2122
@Mock FaceMatchCheckResponse faceMatchCheckResponse;
2223
@Mock FaceComparisonCheckResponse faceComparisonCheckResponse;
@@ -32,133 +33,40 @@ public class GetSessionResultCheckTest {
3233
@Mock ProfileDocumentMatchCheckResponse profileDocumentMatchCheckResponse;
3334
@Mock SynecticsIdentityFraudCheckResponse synecticsIdentityFraudCheckResponse;
3435

35-
GetSessionResult testObj;
36-
37-
@Before
38-
public void setUp() throws Exception {
39-
testObj = new GetSessionResult();
40-
setupGetSessionResult();
41-
}
42-
43-
@Test
44-
public void shouldFilterAuthenticityChecks() {
45-
List<AuthenticityCheckResponse> result = testObj.getAuthenticityChecks();
46-
47-
assertThat(result, contains(authenticityCheckResponse));
48-
}
49-
50-
@Test
51-
public void shouldFilterLivenessChecks() {
52-
List<LivenessCheckResponse> result = testObj.getLivenessChecks();
53-
54-
assertThat(result, contains(livenessCheckResponse));
55-
}
56-
57-
@Test
58-
public void shouldFilterTextDataChecks() {
59-
List<TextDataCheckResponse> result = testObj.getIdDocumentTextDataChecks();
60-
61-
assertThat(result, contains(textDataCheckResponse));
62-
}
63-
64-
@Test
65-
public void shouldFilterSupplementaryDocumentTextDataChecks() {
66-
List<SupplementaryDocumentTextDataCheckResponse> result = testObj.getSupplementaryDocumentTextDataChecks();
67-
68-
assertThat(result, contains(supplementaryDocumentTextDataCheckResponse));
69-
}
70-
7136
@Test
72-
public void shouldFilterFaceMatchChecks() {
73-
List<FaceMatchCheckResponse> result = testObj.getFaceMatchChecks();
74-
75-
assertThat(result, contains(faceMatchCheckResponse));
76-
}
77-
78-
@Test
79-
public void shouldFilterFaceComparisonChecks() {
80-
List<FaceComparisonCheckResponse> result = testObj.getFaceComparisonChecks();
81-
82-
assertThat(result, contains(faceComparisonCheckResponse));
83-
}
84-
85-
@Test
86-
public void shouldFilterIdDocumentComparisonChecks() {
87-
List<IdDocumentComparisonCheckResponse> result = testObj.getIdDocumentComparisonChecks();
88-
89-
assertThat(result, contains(idDocumentComparisonCheckResponse));
90-
}
91-
92-
@Test
93-
public void shouldFilterThirdPartyIdentityChecks() {
94-
List<ThirdPartyIdentityCheckResponse> result = testObj.getThirdPartyIdentityChecks();
95-
96-
assertThat(result, contains(thirdPartyIdentityCheckResponse));
97-
}
98-
99-
@Test
100-
public void shouldFilterWatchlistScreeningChecks() {
101-
List<WatchlistScreeningCheckResponse> result = testObj.getWatchlistScreeningChecks();
102-
103-
assertThat(result, contains(watchlistScreeningCheckResponse));
104-
}
105-
106-
@Test
107-
public void shouldFilterIbvVisualReviewChecks() {
108-
List<IbvVisualReviewCheckResponse> result = testObj.getIbvVisualReviewChecks();
109-
110-
assertThat(result, contains(ibvVisualReviewCheckResponse));
111-
}
112-
113-
@Test
114-
public void shouldFilterDocumentSchemeValidityChecks() {
115-
List<DocumentSchemeValidityCheckResponse> result = testObj.getDocumentSchemeValidityChecks();
116-
117-
assertThat(result, contains(documentSchemeValidityCheckResponse));
118-
}
119-
120-
@Test
121-
public void shouldFilterProfileDocumentMatchChecks() {
122-
List<ProfileDocumentMatchCheckResponse> result = testObj.getProfileDocumentMatchChecks();
123-
124-
assertThat(result, contains(profileDocumentMatchCheckResponse));
125-
}
126-
127-
@Test
128-
public void shouldFilterThirdPartyIdentityFraudOneCheck() {
129-
List<ThirdPartyIdentityFraudOneCheckResponse> result = testObj.getThirdPartyIdentityFraudOneChecks();
130-
131-
assertThat(result, contains(thirdPartyIdentityFraudOneCheckResponse));
132-
}
133-
134-
@Test
135-
public void shouldFilterSynecticsIdentityFraudCheck() {
136-
List<SynecticsIdentityFraudCheckResponse> result = testObj.getSynecticsIdentityFraudChecks();
137-
138-
assertThat(result, contains(synecticsIdentityFraudCheckResponse));
139-
}
140-
141-
private void setupGetSessionResult() {
142-
FieldSetter.setField(
143-
testObj,
144-
"checks",
145-
Arrays.asList(
146-
authenticityCheckResponse,
147-
livenessCheckResponse,
148-
textDataCheckResponse,
149-
supplementaryDocumentTextDataCheckResponse,
150-
faceMatchCheckResponse,
151-
faceComparisonCheckResponse,
152-
idDocumentComparisonCheckResponse,
153-
thirdPartyIdentityCheckResponse,
154-
watchlistScreeningCheckResponse,
155-
thirdPartyIdentityFraudOneCheckResponse,
156-
ibvVisualReviewCheckResponse,
157-
documentSchemeValidityCheckResponse,
158-
profileDocumentMatchCheckResponse,
159-
synecticsIdentityFraudCheckResponse
160-
)
37+
public void shouldFilterChecks() {
38+
List<CheckResponse> allChecks = Arrays.asList(
39+
authenticityCheckResponse,
40+
livenessCheckResponse,
41+
textDataCheckResponse,
42+
supplementaryDocumentTextDataCheckResponse,
43+
faceMatchCheckResponse,
44+
faceComparisonCheckResponse,
45+
idDocumentComparisonCheckResponse,
46+
thirdPartyIdentityCheckResponse,
47+
watchlistScreeningCheckResponse,
48+
thirdPartyIdentityFraudOneCheckResponse,
49+
ibvVisualReviewCheckResponse,
50+
documentSchemeValidityCheckResponse,
51+
profileDocumentMatchCheckResponse,
52+
synecticsIdentityFraudCheckResponse
16153
);
54+
FieldSetter.setField(testObj, "checks", allChecks);
55+
56+
assertThat(testObj.getAuthenticityChecks(), contains(authenticityCheckResponse));
57+
assertThat(testObj.getLivenessChecks(), contains(livenessCheckResponse));
58+
assertThat(testObj.getIdDocumentTextDataChecks(), contains(textDataCheckResponse));
59+
assertThat(testObj.getSupplementaryDocumentTextDataChecks(), contains(supplementaryDocumentTextDataCheckResponse));
60+
assertThat(testObj.getFaceMatchChecks(), contains(faceMatchCheckResponse));
61+
assertThat(testObj.getFaceComparisonChecks(), contains(faceComparisonCheckResponse));
62+
assertThat(testObj.getIdDocumentComparisonChecks(), contains(idDocumentComparisonCheckResponse));
63+
assertThat(testObj.getThirdPartyIdentityChecks(), contains(thirdPartyIdentityCheckResponse));
64+
assertThat(testObj.getWatchlistScreeningChecks(), contains(watchlistScreeningCheckResponse));
65+
assertThat(testObj.getIbvVisualReviewChecks(), contains(ibvVisualReviewCheckResponse));
66+
assertThat(testObj.getDocumentSchemeValidityChecks(), contains(documentSchemeValidityCheckResponse));
67+
assertThat(testObj.getProfileDocumentMatchChecks(), contains(profileDocumentMatchCheckResponse));
68+
assertThat(testObj.getThirdPartyIdentityFraudOneChecks(), contains(thirdPartyIdentityFraudOneCheckResponse));
69+
assertThat(testObj.getSynecticsIdentityFraudChecks(), contains(synecticsIdentityFraudCheckResponse));
16270
}
16371

16472
}

0 commit comments

Comments
 (0)