Skip to content

Commit 6279ca6

Browse files
committed
NA: Drop unhelpful tests on GetSessionResult
1 parent 7f531f2 commit 6279ca6

File tree

1 file changed

+23
-92
lines changed

1 file changed

+23
-92
lines changed

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

Lines changed: 23 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

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

12+
import org.junit.Before;
1213
import org.junit.Test;
1314
import org.junit.runner.RunWith;
1415
import org.mockito.Mock;
@@ -34,185 +35,115 @@ public class GetSessionResultCheckTest {
3435
@Mock ProfileDocumentMatchCheckResponse profileDocumentMatchCheckResponse;
3536
@Mock SynecticsIdentityFraudCheckResponse synecticsIdentityFraudCheckResponse;
3637

37-
GetSessionResult getSessionResult;
38+
GetSessionResult testObj;
39+
40+
@Before
41+
public void setUp() throws Exception {
42+
testObj = new GetSessionResult();
43+
setupGetSessionResult();
44+
}
3845

3946
@Test
4047
public void shouldFilterAuthenticityChecks() {
41-
getSessionResult = new GetSessionResult();
42-
43-
setupGetSessionResult();
48+
List<AuthenticityCheckResponse> result = testObj.getAuthenticityChecks();
4449

45-
List<AuthenticityCheckResponse> result = getSessionResult.getAuthenticityChecks();
46-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
4750
assertThat(result, hasSize(1));
4851
}
4952

5053
@Test
5154
public void shouldFilterLivenessChecks() {
52-
getSessionResult = new GetSessionResult();
55+
List<LivenessCheckResponse> result = testObj.getLivenessChecks();
5356

54-
setupGetSessionResult();
55-
56-
List<LivenessCheckResponse> result = getSessionResult.getLivenessChecks();
57-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
5857
assertThat(result, hasSize(1));
5958
}
6059

6160
@Test
6261
public void shouldFilterTextDataChecks() {
63-
getSessionResult = new GetSessionResult();
62+
List<TextDataCheckResponse> result = testObj.getIdDocumentTextDataChecks();
6463

65-
setupGetSessionResult();
66-
67-
List<TextDataCheckResponse> result = getSessionResult.getIdDocumentTextDataChecks();
68-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
6964
assertThat(result, hasSize(1));
7065
}
7166

7267
@Test
7368
public void shouldFilterSupplementaryDocumentTextDataChecks() {
74-
getSessionResult = new GetSessionResult();
75-
76-
setupGetSessionResult();
69+
List<SupplementaryDocumentTextDataCheckResponse> result = testObj.getSupplementaryDocumentTextDataChecks();
7770

78-
List<SupplementaryDocumentTextDataCheckResponse> result = getSessionResult.getSupplementaryDocumentTextDataChecks();
79-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
8071
assertThat(result, hasSize(1));
8172
}
8273

8374
@Test
8475
public void shouldFilterFaceMatchChecks() {
85-
getSessionResult = new GetSessionResult();
86-
87-
setupGetSessionResult();
76+
List<FaceMatchCheckResponse> result = testObj.getFaceMatchChecks();
8877

89-
List<FaceMatchCheckResponse> result = getSessionResult.getFaceMatchChecks();
90-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
9178
assertThat(result, hasSize(1));
9279
}
9380

9481
@Test
9582
public void shouldFilterFaceComparisonChecks() {
96-
getSessionResult = new GetSessionResult();
97-
98-
setupGetSessionResult();
83+
List<FaceComparisonCheckResponse> result = testObj.getFaceComparisonChecks();
9984

100-
List<FaceComparisonCheckResponse> result = getSessionResult.getFaceComparisonChecks();
101-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
10285
assertThat(result, hasSize(1));
10386
}
10487

10588
@Test
10689
public void shouldFilterIdDocumentComparisonChecks() {
107-
getSessionResult = new GetSessionResult();
90+
List<IdDocumentComparisonCheckResponse> result = testObj.getIdDocumentComparisonChecks();
10891

109-
setupGetSessionResult();
110-
111-
List<IdDocumentComparisonCheckResponse> result = getSessionResult.getIdDocumentComparisonChecks();
112-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
11392
assertThat(result, hasSize(1));
11493
}
11594

11695
@Test
11796
public void shouldFilterThirdPartyIdentityChecks() {
118-
getSessionResult = new GetSessionResult();
97+
List<ThirdPartyIdentityCheckResponse> result = testObj.getThirdPartyIdentityChecks();
11998

120-
setupGetSessionResult();
121-
122-
List<ThirdPartyIdentityCheckResponse> result = getSessionResult.getThirdPartyIdentityChecks();
123-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
12499
assertThat(result, hasSize(1));
125100
}
126101

127102
@Test
128103
public void shouldFilterWatchlistScreeningChecks() {
129-
getSessionResult = new GetSessionResult();
104+
List<WatchlistScreeningCheckResponse> result = testObj.getWatchlistScreeningChecks();
130105

131-
setupGetSessionResult();
132-
133-
List<WatchlistScreeningCheckResponse> result = getSessionResult.getWatchlistScreeningChecks();
134-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
135106
assertThat(result, hasSize(1));
136107
}
137108

138109
@Test
139110
public void shouldFilterIbvVisualReviewChecks() {
140-
getSessionResult = new GetSessionResult();
141-
142-
setupGetSessionResult();
111+
List<IbvVisualReviewCheckResponse> result = testObj.getIbvVisualReviewChecks();
143112

144-
List<IbvVisualReviewCheckResponse> result = getSessionResult.getIbvVisualReviewChecks();
145-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
146113
assertThat(result, hasSize(1));
147114
}
148115

149116
@Test
150117
public void shouldFilterDocumentSchemeValidityChecks() {
151-
getSessionResult = new GetSessionResult();
152-
153-
setupGetSessionResult();
118+
List<DocumentSchemeValidityCheckResponse> result = testObj.getDocumentSchemeValidityChecks();
154119

155-
List<DocumentSchemeValidityCheckResponse> result = getSessionResult.getDocumentSchemeValidityChecks();
156-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
157120
assertThat(result, hasSize(1));
158121
}
159122

160123
@Test
161124
public void shouldFilterProfileDocumentMatchChecks() {
162-
getSessionResult = new GetSessionResult();
125+
List<ProfileDocumentMatchCheckResponse> result = testObj.getProfileDocumentMatchChecks();
163126

164-
setupGetSessionResult();
165-
166-
List<ProfileDocumentMatchCheckResponse> result = getSessionResult.getProfileDocumentMatchChecks();
167-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
168127
assertThat(result, hasSize(1));
169128
}
170129

171130
@Test
172131
public void shouldFilterThirdPartyIdentityFraudOneCheck() {
173-
getSessionResult = new GetSessionResult();
132+
List<ThirdPartyIdentityFraudOneCheckResponse> result = testObj.getThirdPartyIdentityFraudOneChecks();
174133

175-
setupGetSessionResult();
176-
177-
List<ThirdPartyIdentityFraudOneCheckResponse> result = getSessionResult.getThirdPartyIdentityFraudOneChecks();
178-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
179134
assertThat(result, hasSize(1));
180135
}
181136

182137
@Test
183138
public void shouldFilterSynecticsIdentityFraudCheck() {
184-
getSessionResult = new GetSessionResult();
139+
List<SynecticsIdentityFraudCheckResponse> result = testObj.getSynecticsIdentityFraudChecks();
185140

186-
setupGetSessionResult();
187-
188-
List<SynecticsIdentityFraudCheckResponse> result = getSessionResult.getSynecticsIdentityFraudChecks();
189-
assertThat(getSessionResult.getChecks(), hasSize(SESSION_CHECKS));
190141
assertThat(result, hasSize(1));
191142
}
192143

193-
@Test
194-
public void shouldReturnEmptyLists() {
195-
getSessionResult = new GetSessionResult();
196-
197-
FieldSetter.setField(
198-
getSessionResult,
199-
"checks",
200-
new ArrayList<>()
201-
);
202-
203-
assertThat(getSessionResult.getChecks(), hasSize(0));
204-
assertThat(getSessionResult.getAuthenticityChecks(), hasSize(0));
205-
assertThat(getSessionResult.getFaceMatchChecks(), hasSize(0));
206-
assertThat(getSessionResult.getIdDocumentTextDataChecks(), hasSize(0));
207-
assertThat(getSessionResult.getSupplementaryDocumentTextDataChecks(), hasSize(0));
208-
assertThat(getSessionResult.getLivenessChecks(), hasSize(0));
209-
assertThat(getSessionResult.getThirdPartyIdentityFraudOneChecks(), hasSize(0));
210-
assertThat(getSessionResult.getSynecticsIdentityFraudChecks(), hasSize(0));
211-
}
212-
213144
private void setupGetSessionResult() {
214145
FieldSetter.setField(
215-
getSessionResult,
146+
testObj,
216147
"checks",
217148
Arrays.asList(
218149
authenticityCheckResponse,

0 commit comments

Comments
 (0)