Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,28 @@ public abstract class SandboxCheck {
@JsonProperty("result")
private final SandboxCheckResult result;

SandboxCheck(SandboxCheckResult result) {
@JsonProperty("handled_check_limit")
private final Integer handledCheckLimit;

SandboxCheck(SandboxCheckResult result, Integer handledCheckLimit) {
this.result = result;
this.handledCheckLimit = handledCheckLimit;
}

public SandboxCheckResult getResult() {
return result;
}

public Integer getHandledCheckLimit() {
return handledCheckLimit;
}

static abstract class Builder<T extends Builder<T>> {

protected SandboxRecommendation recommendation;
protected List<SandboxBreakdown> breakdown;
protected String reportTemplate;
protected Integer handledCheckLimit;

public T withRecommendation(SandboxRecommendation recommendation) {
this.recommendation = recommendation;
Expand All @@ -54,6 +63,11 @@ public T withReportTemplate(String reportTemplate) {
return self();
}

public T withHandledCheckLimit(Integer handledCheckLimit) {
this.handledCheckLimit = handledCheckLimit;
return self();
}

protected abstract T self();

public abstract SandboxCheck build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

public class SandboxDocumentAuthenticityCheck extends SandboxDocumentCheck {

private SandboxDocumentAuthenticityCheck(SandboxCheckResult result, SandboxDocumentFilter documentFilter) {
super(result, documentFilter);
private SandboxDocumentAuthenticityCheck(SandboxCheckResult result, Integer handledCheckLimit, SandboxDocumentFilter documentFilter) {
super(result, handledCheckLimit, documentFilter);
}

public static Builder builder() {
Expand All @@ -33,7 +33,7 @@ public SandboxDocumentAuthenticityCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxDocumentAuthenticityCheck(result, documentFilter);
return new SandboxDocumentAuthenticityCheck(result, handledCheckLimit, documentFilter);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class SandboxDocumentCheck extends SandboxCheck {
@JsonProperty("document_filter")
private SandboxDocumentFilter documentFilter;

SandboxDocumentCheck(SandboxCheckResult result, SandboxDocumentFilter documentFilter) {
super(result);
SandboxDocumentCheck(SandboxCheckResult result, Integer handledCheckLimit, SandboxDocumentFilter documentFilter) {
super(result, handledCheckLimit);
this.documentFilter = documentFilter;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

public class SandboxDocumentFaceMatchCheck extends SandboxDocumentCheck {

private SandboxDocumentFaceMatchCheck(SandboxCheckResult result, SandboxDocumentFilter documentFilter) {
super(result, documentFilter);
private SandboxDocumentFaceMatchCheck(SandboxCheckResult result, Integer handledCheckLimit, SandboxDocumentFilter documentFilter) {
super(result, handledCheckLimit, documentFilter);
}

public static Builder builder() {
Expand All @@ -33,7 +33,7 @@ public SandboxDocumentFaceMatchCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxDocumentFaceMatchCheck(result, documentFilter);
return new SandboxDocumentFaceMatchCheck(result, handledCheckLimit, documentFilter);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class SandboxDocumentTextDataCheck extends SandboxDocumentCheck {

private SandboxDocumentTextDataCheck(SandboxDocumentTextDataCheckResult result, SandboxDocumentFilter documentFilter) {
super(result, documentFilter);
private SandboxDocumentTextDataCheck(SandboxDocumentTextDataCheckResult result, Integer handledCheckLimit, SandboxDocumentFilter documentFilter) {
super(result, handledCheckLimit, documentFilter);
}

public static Builder builder() {
Expand Down Expand Up @@ -60,7 +60,7 @@ public SandboxDocumentTextDataCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxDocumentTextDataCheckResult result = new SandboxDocumentTextDataCheckResult(report, reportTemplate, documentFields);

return new SandboxDocumentTextDataCheck(result, documentFilter);
return new SandboxDocumentTextDataCheck(result, handledCheckLimit, documentFilter);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

public class SandboxFaceComparisonCheck extends SandboxCheck {

private SandboxFaceComparisonCheck(SandboxCheckResult result) {
super(result);
private SandboxFaceComparisonCheck(SandboxCheckResult result, Integer handledCheckLimit) {
super(result, handledCheckLimit);
}

public static Builder builder() {
Expand All @@ -31,7 +31,7 @@ public SandboxFaceComparisonCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxFaceComparisonCheck(result);
return new SandboxFaceComparisonCheck(result, handledCheckLimit);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public class SandboxIdDocumentComparisonCheck extends SandboxCheck {
@JsonProperty("secondary_document_filter")
private final SandboxDocumentFilter secondaryDocumentFilter;

private SandboxIdDocumentComparisonCheck(SandboxCheckResult result, SandboxDocumentFilter secondaryDocumentFilter) {
super(result);
private SandboxIdDocumentComparisonCheck(SandboxCheckResult result, Integer handledCheckLimit, SandboxDocumentFilter secondaryDocumentFilter) {
super(result, handledCheckLimit);
this.secondaryDocumentFilter = secondaryDocumentFilter;
}

Expand Down Expand Up @@ -44,7 +44,7 @@ public SandboxIdDocumentComparisonCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxIdDocumentComparisonCheck(result, secondaryDocumentFilter);
return new SandboxIdDocumentComparisonCheck(result, handledCheckLimit, secondaryDocumentFilter);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public class SandboxLivenessCheck extends SandboxCheck {
@JsonProperty("response_delay")
private final Integer responseDelay;

SandboxLivenessCheck(SandboxCheckResult result, String livenessType, Integer responseDelay) {
super(result);
SandboxLivenessCheck(SandboxCheckResult result, Integer handledCheckLimit, String livenessType, Integer responseDelay) {
super(result, handledCheckLimit);
this.livenessType = livenessType;
this.responseDelay = responseDelay;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public SandboxLivenessCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxLivenessCheck(result, DocScanConstants.STATIC, responseDelay);
return new SandboxLivenessCheck(result, handledCheckLimit, DocScanConstants.STATIC, responseDelay);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

public class SandboxSupplementaryDocumentTextDataCheck extends SandboxDocumentCheck {

private SandboxSupplementaryDocumentTextDataCheck(SandboxSupplementaryDocumentTextDataCheckResult result, SandboxDocumentFilter documentFilter) {
super(result, documentFilter);
private SandboxSupplementaryDocumentTextDataCheck(SandboxSupplementaryDocumentTextDataCheckResult result, Integer handledCheckLimit, SandboxDocumentFilter documentFilter) {
super(result, handledCheckLimit, documentFilter);
}

public static Builder builder() {
Expand Down Expand Up @@ -57,7 +57,7 @@ public SandboxSupplementaryDocumentTextDataCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxSupplementaryDocumentTextDataCheckResult result = new SandboxSupplementaryDocumentTextDataCheckResult(report, reportTemplate, documentFields);

return new SandboxSupplementaryDocumentTextDataCheck(result, documentFilter);
return new SandboxSupplementaryDocumentTextDataCheck(result, handledCheckLimit, documentFilter);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

public class SandboxSynecticsIdentityFraudCheck extends SandboxCheck {

private SandboxSynecticsIdentityFraudCheck(SandboxCheckResult result) {
super(result);
private SandboxSynecticsIdentityFraudCheck(SandboxCheckResult result, Integer handledCheckLimit) {
super(result, handledCheckLimit);
}

public static Builder builder() {
Expand All @@ -31,7 +31,7 @@ public SandboxSynecticsIdentityFraudCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxSynecticsIdentityFraudCheck(result);
return new SandboxSynecticsIdentityFraudCheck(result, handledCheckLimit);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

public class SandboxThirdPartyIdentityCheck extends SandboxCheck {

private SandboxThirdPartyIdentityCheck(SandboxCheckResult result) {
super(result);
private SandboxThirdPartyIdentityCheck(SandboxCheckResult result, Integer handledCheckLimit) {
super(result, handledCheckLimit);
}

public static Builder builder() {
Expand All @@ -32,7 +32,7 @@ public SandboxThirdPartyIdentityCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxThirdPartyIdentityCheck(result);
return new SandboxThirdPartyIdentityCheck(result, handledCheckLimit);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

public class SandboxThirdPartyIdentityFraudOneCheck extends SandboxCheck {

private SandboxThirdPartyIdentityFraudOneCheck(SandboxCheckResult result) {
super(result);
private SandboxThirdPartyIdentityFraudOneCheck(SandboxCheckResult result, Integer handledCheckLimit) {
super(result, handledCheckLimit);
}

public static Builder builder() {
Expand All @@ -31,7 +31,7 @@ public SandboxThirdPartyIdentityFraudOneCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxThirdPartyIdentityFraudOneCheck(result);
return new SandboxThirdPartyIdentityFraudOneCheck(result, handledCheckLimit);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class SandboxWatchlistAdvancedCaCheck extends SandboxCheck {
@JsonProperty("sources_filter")
private final SandboxCaSourcesFilter sourcesFilter;

private SandboxWatchlistAdvancedCaCheck(SandboxCheckResult result, SandboxCaSourcesFilter sourcesFilter) {
super(result);
private SandboxWatchlistAdvancedCaCheck(SandboxCheckResult result, Integer handledCheckLimit, SandboxCaSourcesFilter sourcesFilter) {
super(result, handledCheckLimit);
this.sourcesFilter = sourcesFilter;
}

Expand Down Expand Up @@ -55,7 +55,7 @@ public SandboxWatchlistAdvancedCaCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxWatchlistAdvancedCaCheck(result, sourcesFilter);
return new SandboxWatchlistAdvancedCaCheck(result, handledCheckLimit, sourcesFilter);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

public class SandboxWatchlistScreeningCheck extends SandboxCheck {

private SandboxWatchlistScreeningCheck(SandboxCheckResult result) {
super(result);
private SandboxWatchlistScreeningCheck(SandboxCheckResult result, Integer handledCheckLimit) {
super(result, handledCheckLimit);
}

public static Builder builder() {
Expand All @@ -31,7 +31,7 @@ public SandboxWatchlistScreeningCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxWatchlistScreeningCheck(result);
return new SandboxWatchlistScreeningCheck(result, handledCheckLimit);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public SandboxLivenessCheck build() {
: new SandboxCheckReport(recommendation, breakdown);
SandboxCheckResult result = new SandboxCheckResult(report, reportTemplate);

return new SandboxLivenessCheck(result, DocScanConstants.ZOOM, responseDelay);
return new SandboxLivenessCheck(result, handledCheckLimit, DocScanConstants.ZOOM, responseDelay);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,15 @@ public void builder_shouldAllowListOfBreakdowns() {
assertThat(result.getResult().getReport().getBreakdown(), hasSize(3));
}

@Test
public void builder_shouldAllowSettingHandledCheckLimit() {
SandboxDocumentAuthenticityCheck result = SandboxDocumentAuthenticityCheck.builder()
.withRecommendation(sandboxRecommendationMock)
.withBreakdown(sandboxBreakdownMock)
.withHandledCheckLimit(3)
.build();

assertThat(result.getHandledCheckLimit(), is(3));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,15 @@ public void builder_shouldBuildCorrectly() {
assertThat(result.getDocumentFilter(), is(nullValue()));
}

@Test
public void builder_shouldAllowSettingHandledCheckLimit() {
SandboxDocumentFaceMatchCheck result = SandboxDocumentFaceMatchCheck.builder()
.withRecommendation(sandboxRecommendationMock)
.withBreakdown(sandboxBreakdownMock)
.withHandledCheckLimit(3)
.build();

assertThat(result.getHandledCheckLimit(), is(3));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.hasKey;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.fail;

import java.util.HashMap;
Expand Down Expand Up @@ -56,4 +57,15 @@ public void builder_shouldAllowMapForDocumentFields() {
assertThat(result.getResult().getDocumentFields(), hasEntry("firstKey", (Object) "firstValue"));
assertThat(result.getResult().getDocumentFields(), hasEntry("secondKey", (Object) 100));
}

@Test
public void builder_shouldAllowSettingHandledCheckLimit() {
SandboxDocumentTextDataCheck result = SandboxDocumentTextDataCheck.builder()
.withRecommendation(sandboxRecommendationMock)
.withBreakdown(sandboxBreakdownMock)
.withHandledCheckLimit(3)
.build();

assertThat(result.getHandledCheckLimit(), is(3));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ public void builder_shouldBuildCorrectly() {
assertThat(result.getResult().getReport().getRecommendation(), is(sandboxRecommendationMock));
}

@Test
public void builder_shouldAllowSettingHandledCheckLimit() {
SandboxIdDocumentComparisonCheck result = SandboxIdDocumentComparisonCheck.builder()
.withRecommendation(sandboxRecommendationMock)
.withBreakdown(sandboxBreakdownMock)
.withHandledCheckLimit(3)
.build();

assertThat(result.getHandledCheckLimit(), is(3));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.hasKey;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.fail;

import java.util.HashMap;
Expand Down Expand Up @@ -56,4 +57,15 @@ public void builder_shouldAllowMapForDocumentFields() {
assertThat(result.getResult().getDocumentFields(), hasEntry("firstKey", (Object) "firstValue"));
assertThat(result.getResult().getDocumentFields(), hasEntry("secondKey", (Object) 100));
}

@Test
public void builder_shouldAllowSettingHandledCheckLimit() {
SandboxSupplementaryDocumentTextDataCheck result = SandboxSupplementaryDocumentTextDataCheck.builder()
.withRecommendation(sandboxRecommendationMock)
.withBreakdown(sandboxBreakdownMock)
.withHandledCheckLimit(3)
.build();

assertThat(result.getHandledCheckLimit(), is(3));
}
}
Loading
Loading