Skip to content

Commit ff11e3c

Browse files
committed
SDK-2675: Add support for configuring check result, for WATCHLIST_SCREENING check in the sandbox
1 parent 42e700a commit ff11e3c

File tree

3 files changed

+70
-1
lines changed

3 files changed

+70
-1
lines changed

yoti-sdk-sandbox/src/main/java/com/yoti/api/client/sandbox/docs/request/SandboxCheckReports.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import static com.yoti.api.client.docs.DocScanConstants.SYNECTICS_IDENTITY_FRAUD;
1111
import static com.yoti.api.client.docs.DocScanConstants.THIRD_PARTY_IDENTITY;
1212
import static com.yoti.api.client.docs.DocScanConstants.THIRD_PARTY_IDENTITY_FRAUD_ONE;
13+
import static com.yoti.api.client.docs.DocScanConstants.WATCHLIST_SCREENING;
1314

1415
import java.util.ArrayList;
1516
import java.util.List;
@@ -24,6 +25,7 @@
2425
import com.yoti.api.client.sandbox.docs.request.check.SandboxSynecticsIdentityFraudCheck;
2526
import com.yoti.api.client.sandbox.docs.request.check.SandboxThirdPartyIdentityCheck;
2627
import com.yoti.api.client.sandbox.docs.request.check.SandboxThirdPartyIdentityFraudOneCheck;
28+
import com.yoti.api.client.sandbox.docs.request.check.SandboxWatchlistScreeningCheck;
2729

2830
import com.fasterxml.jackson.annotation.JsonInclude;
2931
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -61,6 +63,9 @@ public class SandboxCheckReports {
6163
@JsonProperty(THIRD_PARTY_IDENTITY_FRAUD_ONE)
6264
private final SandboxThirdPartyIdentityFraudOneCheck thirdPartyIdentityFraudOneCheck;
6365

66+
@JsonProperty(WATCHLIST_SCREENING)
67+
private final SandboxWatchlistScreeningCheck watchlistScreeningCheck;
68+
6469
@JsonProperty("async_report_delay")
6570
private final Integer asyncReportDelay;
6671

@@ -74,6 +79,7 @@ public class SandboxCheckReports {
7479
SandboxFaceComparisonCheck faceComparisonCheck,
7580
List<SandboxSynecticsIdentityFraudCheck> synecticsIdentityFraudChecks,
7681
SandboxThirdPartyIdentityFraudOneCheck thirdPartyIdentityFraudOneCheck,
82+
SandboxWatchlistScreeningCheck watchlistScreeningCheck,
7783
Integer asyncReportsDelay) {
7884
this.documentTextDataChecks = documentTextDataChecks;
7985
this.documentAuthenticityChecks = documentAuthenticityChecks;
@@ -85,6 +91,7 @@ public class SandboxCheckReports {
8591
this.faceComparisonCheck = faceComparisonCheck;
8692
this.synecticsIdentityFraudChecks = synecticsIdentityFraudChecks;
8793
this.thirdPartyIdentityFraudOneCheck = thirdPartyIdentityFraudOneCheck;
94+
this.watchlistScreeningCheck = watchlistScreeningCheck;
8895
this.asyncReportDelay = asyncReportsDelay;
8996
}
9097

@@ -130,6 +137,10 @@ public SandboxThirdPartyIdentityFraudOneCheck getThirdPartyIdentityFraudOneCheck
130137
return thirdPartyIdentityFraudOneCheck;
131138
}
132139

140+
public SandboxWatchlistScreeningCheck getWatchlistScreeningCheck() {
141+
return watchlistScreeningCheck;
142+
}
143+
133144
public Integer getAsyncReportDelay() {
134145
return asyncReportDelay;
135146
}
@@ -159,6 +170,8 @@ public static class Builder {
159170

160171
private SandboxThirdPartyIdentityFraudOneCheck thirdPartyIdentityFraudOneCheck;
161172

173+
private SandboxWatchlistScreeningCheck watchlistScreeningCheck;
174+
162175
private Integer asyncReportDelay;
163176

164177
private Builder() {}
@@ -213,6 +226,11 @@ public Builder withThirdPartyIdentityFraudOneCheck(SandboxThirdPartyIdentityFrau
213226
return this;
214227
}
215228

229+
public Builder withWatchlistScreeningCheck(SandboxWatchlistScreeningCheck watchlistScreeningCheck) {
230+
this.watchlistScreeningCheck = watchlistScreeningCheck;
231+
return this;
232+
}
233+
216234
public Builder withAsyncReportDelay(int asyncReportDelay) {
217235
this.asyncReportDelay = asyncReportDelay;
218236
return this;
@@ -221,7 +239,7 @@ public Builder withAsyncReportDelay(int asyncReportDelay) {
221239
public SandboxCheckReports build() {
222240
return new SandboxCheckReports(textDataCheck, documentAuthenticityCheck, livenessCheck, documentFaceMatchCheck, idDocumentComparisonCheck,
223241
supplementaryDocumentTextDataCheck, thirdPartyIdentityCheck, faceComparisonCheck, synecticsIdentityFraudChecks,
224-
thirdPartyIdentityFraudOneCheck, asyncReportDelay);
242+
thirdPartyIdentityFraudOneCheck, watchlistScreeningCheck, asyncReportDelay);
225243
}
226244

227245
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.yoti.api.client.sandbox.docs.request.check;
2+
3+
import static com.yoti.api.client.spi.remote.util.Validation.notNull;
4+
5+
import com.yoti.api.client.sandbox.docs.request.check.report.SandboxCheckReport;
6+
7+
public class SandboxWatchlistScreeningCheck extends SandboxCheck {
8+
9+
SandboxWatchlistScreeningCheck(SandboxCheckResult result) {
10+
super(result);
11+
}
12+
13+
public static Builder builder() {
14+
return new Builder();
15+
}
16+
17+
/**
18+
* Builder for {@link SandboxWatchlistScreeningCheck}
19+
*/
20+
public static class Builder extends SandboxCheck.Builder<Builder> {
21+
22+
private Builder() {}
23+
24+
@Override
25+
protected Builder self() {
26+
return this;
27+
}
28+
29+
@Override
30+
public SandboxWatchlistScreeningCheck build() {
31+
notNull(recommendation, "recommendation");
32+
33+
SandboxCheckReport report = new SandboxCheckReport(recommendation, breakdown);
34+
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);
35+
36+
return new SandboxWatchlistScreeningCheck(result);
37+
}
38+
39+
}
40+
}

yoti-sdk-sandbox/src/test/java/com/yoti/api/client/sandbox/docs/request/SandboxCheckReportsTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.yoti.api.client.sandbox.docs.request.check.SandboxSynecticsIdentityFraudCheck;
1515
import com.yoti.api.client.sandbox.docs.request.check.SandboxThirdPartyIdentityCheck;
1616
import com.yoti.api.client.sandbox.docs.request.check.SandboxThirdPartyIdentityFraudOneCheck;
17+
import com.yoti.api.client.sandbox.docs.request.check.SandboxWatchlistScreeningCheck;
1718

1819
import org.junit.Test;
1920
import org.junit.runner.RunWith;
@@ -33,6 +34,7 @@ public class SandboxCheckReportsTest {
3334
@Mock SandboxFaceComparisonCheck faceComparisonCheckMock;
3435
@Mock SandboxSynecticsIdentityFraudCheck synecticsIdentityFraudCheckMock;
3536
@Mock SandboxThirdPartyIdentityFraudOneCheck thirdPartyIdentityFraudOneCheckMock;
37+
@Mock SandboxWatchlistScreeningCheck watchlistScreeningCheckMock;
3638

3739
@Test
3840
public void builder_shouldAllowDocumentAuthenticityChecks() {
@@ -131,6 +133,15 @@ public void builder_shouldAllowThirdPartyIdentityFraudOneCheck() {
131133
assertThat(result.getThirdPartyIdentityFraudOneCheck(), is(thirdPartyIdentityFraudOneCheckMock));
132134
}
133135

136+
@Test
137+
public void builder_shouldAllowWatchlistScreeningCheck() {
138+
SandboxCheckReports result = SandboxCheckReports.builder()
139+
.withWatchlistScreeningCheck(watchlistScreeningCheckMock)
140+
.build();
141+
142+
assertThat(result.getWatchlistScreeningCheck(), is(watchlistScreeningCheckMock));
143+
}
144+
134145
@Test
135146
public void builder_shouldAllowOverridingOfAsyncReportDelay() {
136147
SandboxCheckReports result = SandboxCheckReports.builder()

0 commit comments

Comments
 (0)