9
9
10
10
import com .yoti .api .client .spi .remote .util .FieldSetter ;
11
11
12
+ import org .junit .Before ;
12
13
import org .junit .Test ;
13
14
import org .junit .runner .RunWith ;
14
15
import org .mockito .Mock ;
@@ -34,185 +35,115 @@ public class GetSessionResultCheckTest {
34
35
@ Mock ProfileDocumentMatchCheckResponse profileDocumentMatchCheckResponse ;
35
36
@ Mock SynecticsIdentityFraudCheckResponse synecticsIdentityFraudCheckResponse ;
36
37
37
- GetSessionResult getSessionResult ;
38
+ GetSessionResult testObj ;
39
+
40
+ @ Before
41
+ public void setUp () throws Exception {
42
+ testObj = new GetSessionResult ();
43
+ setupGetSessionResult ();
44
+ }
38
45
39
46
@ Test
40
47
public void shouldFilterAuthenticityChecks () {
41
- getSessionResult = new GetSessionResult ();
42
-
43
- setupGetSessionResult ();
48
+ List <AuthenticityCheckResponse > result = testObj .getAuthenticityChecks ();
44
49
45
- List <AuthenticityCheckResponse > result = getSessionResult .getAuthenticityChecks ();
46
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
47
50
assertThat (result , hasSize (1 ));
48
51
}
49
52
50
53
@ Test
51
54
public void shouldFilterLivenessChecks () {
52
- getSessionResult = new GetSessionResult ();
55
+ List < LivenessCheckResponse > result = testObj . getLivenessChecks ();
53
56
54
- setupGetSessionResult ();
55
-
56
- List <LivenessCheckResponse > result = getSessionResult .getLivenessChecks ();
57
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
58
57
assertThat (result , hasSize (1 ));
59
58
}
60
59
61
60
@ Test
62
61
public void shouldFilterTextDataChecks () {
63
- getSessionResult = new GetSessionResult ();
62
+ List < TextDataCheckResponse > result = testObj . getIdDocumentTextDataChecks ();
64
63
65
- setupGetSessionResult ();
66
-
67
- List <TextDataCheckResponse > result = getSessionResult .getIdDocumentTextDataChecks ();
68
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
69
64
assertThat (result , hasSize (1 ));
70
65
}
71
66
72
67
@ Test
73
68
public void shouldFilterSupplementaryDocumentTextDataChecks () {
74
- getSessionResult = new GetSessionResult ();
75
-
76
- setupGetSessionResult ();
69
+ List <SupplementaryDocumentTextDataCheckResponse > result = testObj .getSupplementaryDocumentTextDataChecks ();
77
70
78
- List <SupplementaryDocumentTextDataCheckResponse > result = getSessionResult .getSupplementaryDocumentTextDataChecks ();
79
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
80
71
assertThat (result , hasSize (1 ));
81
72
}
82
73
83
74
@ Test
84
75
public void shouldFilterFaceMatchChecks () {
85
- getSessionResult = new GetSessionResult ();
86
-
87
- setupGetSessionResult ();
76
+ List <FaceMatchCheckResponse > result = testObj .getFaceMatchChecks ();
88
77
89
- List <FaceMatchCheckResponse > result = getSessionResult .getFaceMatchChecks ();
90
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
91
78
assertThat (result , hasSize (1 ));
92
79
}
93
80
94
81
@ Test
95
82
public void shouldFilterFaceComparisonChecks () {
96
- getSessionResult = new GetSessionResult ();
97
-
98
- setupGetSessionResult ();
83
+ List <FaceComparisonCheckResponse > result = testObj .getFaceComparisonChecks ();
99
84
100
- List <FaceComparisonCheckResponse > result = getSessionResult .getFaceComparisonChecks ();
101
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
102
85
assertThat (result , hasSize (1 ));
103
86
}
104
87
105
88
@ Test
106
89
public void shouldFilterIdDocumentComparisonChecks () {
107
- getSessionResult = new GetSessionResult ();
90
+ List < IdDocumentComparisonCheckResponse > result = testObj . getIdDocumentComparisonChecks ();
108
91
109
- setupGetSessionResult ();
110
-
111
- List <IdDocumentComparisonCheckResponse > result = getSessionResult .getIdDocumentComparisonChecks ();
112
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
113
92
assertThat (result , hasSize (1 ));
114
93
}
115
94
116
95
@ Test
117
96
public void shouldFilterThirdPartyIdentityChecks () {
118
- getSessionResult = new GetSessionResult ();
97
+ List < ThirdPartyIdentityCheckResponse > result = testObj . getThirdPartyIdentityChecks ();
119
98
120
- setupGetSessionResult ();
121
-
122
- List <ThirdPartyIdentityCheckResponse > result = getSessionResult .getThirdPartyIdentityChecks ();
123
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
124
99
assertThat (result , hasSize (1 ));
125
100
}
126
101
127
102
@ Test
128
103
public void shouldFilterWatchlistScreeningChecks () {
129
- getSessionResult = new GetSessionResult ();
104
+ List < WatchlistScreeningCheckResponse > result = testObj . getWatchlistScreeningChecks ();
130
105
131
- setupGetSessionResult ();
132
-
133
- List <WatchlistScreeningCheckResponse > result = getSessionResult .getWatchlistScreeningChecks ();
134
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
135
106
assertThat (result , hasSize (1 ));
136
107
}
137
108
138
109
@ Test
139
110
public void shouldFilterIbvVisualReviewChecks () {
140
- getSessionResult = new GetSessionResult ();
141
-
142
- setupGetSessionResult ();
111
+ List <IbvVisualReviewCheckResponse > result = testObj .getIbvVisualReviewChecks ();
143
112
144
- List <IbvVisualReviewCheckResponse > result = getSessionResult .getIbvVisualReviewChecks ();
145
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
146
113
assertThat (result , hasSize (1 ));
147
114
}
148
115
149
116
@ Test
150
117
public void shouldFilterDocumentSchemeValidityChecks () {
151
- getSessionResult = new GetSessionResult ();
152
-
153
- setupGetSessionResult ();
118
+ List <DocumentSchemeValidityCheckResponse > result = testObj .getDocumentSchemeValidityChecks ();
154
119
155
- List <DocumentSchemeValidityCheckResponse > result = getSessionResult .getDocumentSchemeValidityChecks ();
156
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
157
120
assertThat (result , hasSize (1 ));
158
121
}
159
122
160
123
@ Test
161
124
public void shouldFilterProfileDocumentMatchChecks () {
162
- getSessionResult = new GetSessionResult ();
125
+ List < ProfileDocumentMatchCheckResponse > result = testObj . getProfileDocumentMatchChecks ();
163
126
164
- setupGetSessionResult ();
165
-
166
- List <ProfileDocumentMatchCheckResponse > result = getSessionResult .getProfileDocumentMatchChecks ();
167
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
168
127
assertThat (result , hasSize (1 ));
169
128
}
170
129
171
130
@ Test
172
131
public void shouldFilterThirdPartyIdentityFraudOneCheck () {
173
- getSessionResult = new GetSessionResult ();
132
+ List < ThirdPartyIdentityFraudOneCheckResponse > result = testObj . getThirdPartyIdentityFraudOneChecks ();
174
133
175
- setupGetSessionResult ();
176
-
177
- List <ThirdPartyIdentityFraudOneCheckResponse > result = getSessionResult .getThirdPartyIdentityFraudOneChecks ();
178
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
179
134
assertThat (result , hasSize (1 ));
180
135
}
181
136
182
137
@ Test
183
138
public void shouldFilterSynecticsIdentityFraudCheck () {
184
- getSessionResult = new GetSessionResult ();
139
+ List < SynecticsIdentityFraudCheckResponse > result = testObj . getSynecticsIdentityFraudChecks ();
185
140
186
- setupGetSessionResult ();
187
-
188
- List <SynecticsIdentityFraudCheckResponse > result = getSessionResult .getSynecticsIdentityFraudChecks ();
189
- assertThat (getSessionResult .getChecks (), hasSize (SESSION_CHECKS ));
190
141
assertThat (result , hasSize (1 ));
191
142
}
192
143
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
-
213
144
private void setupGetSessionResult () {
214
145
FieldSetter .setField (
215
- getSessionResult ,
146
+ testObj ,
216
147
"checks" ,
217
148
Arrays .asList (
218
149
authenticityCheckResponse ,
0 commit comments