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 @@ -43,10 +43,10 @@ internal class IsNewEnrolmentUseCase @Inject constructor() {
private fun isResultBelowMediumThreshold(
projectConfiguration: ProjectConfiguration,
matchResult: MatchResult,
): Boolean = projectConfiguration
): Boolean = matchResult.results.isEmpty() || projectConfiguration
.getModalitySdkConfig(matchResult.sdk)
?.decisionPolicy
?.medium
?.toFloat()
?.let { threshold -> matchResult.results.isNotEmpty() && matchResult.results.all { it.comparisonScore < threshold } } != false
?.let { threshold -> matchResult.results.all { it.comparisonScore < threshold } } != false
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,23 @@ internal class IsNewEnrolmentUseCaseTest {
assertThat(useCase(projectConfiguration, listOf())).isTrue()
}

@Test
fun `Results are new enrolment if all match result is empty`() {
every { projectConfiguration.general.duplicateBiometricEnrolmentCheck } returns true

assertThat(
useCase(
projectConfiguration,
listOf(
MatchResult(
listOf(),
FingerprintConfiguration.BioSdk.SECUGEN_SIM_MATCHER,
),
),
),
).isTrue()
}

@Test
fun `Results are new enrolment if fingerprint match results are of lower then medium confidence`() {
every { projectConfiguration.general.duplicateBiometricEnrolmentCheck } returns true
Expand Down