8
8
9
9
import com .yoti .api .client .spi .remote .util .FieldSetter ;
10
10
11
- import org .junit .Before ;
12
11
import org .junit .Test ;
13
12
import org .junit .runner .RunWith ;
14
13
import org .mockito .Mock ;
17
16
@ RunWith (MockitoJUnitRunner .class )
18
17
public class GetSessionResultCheckTest {
19
18
19
+ GetSessionResult testObj = new GetSessionResult ();
20
+
20
21
@ Mock AuthenticityCheckResponse authenticityCheckResponse ;
21
22
@ Mock FaceMatchCheckResponse faceMatchCheckResponse ;
22
23
@ Mock FaceComparisonCheckResponse faceComparisonCheckResponse ;
@@ -32,133 +33,40 @@ public class GetSessionResultCheckTest {
32
33
@ Mock ProfileDocumentMatchCheckResponse profileDocumentMatchCheckResponse ;
33
34
@ Mock SynecticsIdentityFraudCheckResponse synecticsIdentityFraudCheckResponse ;
34
35
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
-
71
36
@ 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
161
53
);
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 ));
162
70
}
163
71
164
72
}
0 commit comments