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 @@ -74,7 +74,8 @@ internal class LibSimprintsResponseMapper @Inject constructor() {
guid = response.matchResult.guid,
),
)
putBoolean(Constants.SIMPRINTS_VERIFICATION_SUCCESS, response.matchResult.verificationSuccess == true)
response.matchResult.verificationSuccess
?.let { putBoolean(Constants.SIMPRINTS_VERIFICATION_SUCCESS, it) }
}

else -> putString(
Expand All @@ -83,7 +84,7 @@ internal class LibSimprintsResponseMapper @Inject constructor() {
guid = response.matchResult.guid,
confidence = response.matchResult.confidenceScore.toFloat(),
confidenceBand = ConfidenceBand.valueOf(response.matchResult.matchConfidence.name),
isSuccess = response.matchResult.verificationSuccess == true,
isSuccess = response.matchResult.verificationSuccess,
).toJson(),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class LibSimprintsResponseMapperTest {
assertThat(extraVerification?.tier).isEqualTo(LegacyTier.TIER_1)
assertThat(extraVerification?.getConfidence()).isEqualTo(50)
assertThat(extras.getBoolean(Constants.SIMPRINTS_BIOMETRICS_COMPLETE_CHECK)).isTrue()
assertThat(extras.getBoolean(Constants.SIMPRINTS_VERIFICATION_SUCCESS)).isFalse() // Default value
assertThat(extras.keySet()).doesNotContain(Constants.SIMPRINTS_VERIFICATION_SUCCESS)
}

@Test
Expand All @@ -179,6 +179,7 @@ class LibSimprintsResponseMapperTest {
assertThat(extraVerification?.tier).isEqualTo(LegacyTier.TIER_1)
assertThat(extraVerification?.getConfidence()).isEqualTo(50)
assertThat(extras.getBoolean(Constants.SIMPRINTS_BIOMETRICS_COMPLETE_CHECK)).isTrue()
assertThat(extras.keySet()).contains(Constants.SIMPRINTS_VERIFICATION_SUCCESS)
assertThat(extras.getBoolean(Constants.SIMPRINTS_VERIFICATION_SUCCESS)).isEqualTo(false)
}

Expand All @@ -204,7 +205,6 @@ class LibSimprintsResponseMapperTest {
assertThat(extraVerification?.guid).isEqualTo("guid")
assertThat(extraVerification?.tier).isEqualTo(LegacyTier.TIER_1)
assertThat(extraVerification?.getConfidence()).isEqualTo(50)
// assertThat(extraVerification?.isSuccess).isTrue()
assertThat(extras.getBoolean(Constants.SIMPRINTS_BIOMETRICS_COMPLETE_CHECK)).isTrue()
assertThat(extras.getBoolean(Constants.SIMPRINTS_VERIFICATION_SUCCESS)).isTrue()
}
Expand Down Expand Up @@ -235,6 +235,32 @@ class LibSimprintsResponseMapperTest {
assertThat(extras.getBoolean(Constants.SIMPRINTS_BIOMETRICS_COMPLETE_CHECK)).isTrue()
}

@Test
fun `correctly maps verify response without success after LibSimprints refactoring`() {
val extras = mapper(
ActionResponse.VerifyActionResponse(
actionIdentifier = VerifyActionFactory
.getIdentifier()
.copy(contractVersion = VersionsList.INITIAL_REWORK),
sessionId = "sessionId",
matchResult = AppMatchResult(
guid = "guid",
confidenceScore = 50,
matchConfidence = AppMatchConfidence.HIGH,
verificationSuccess = null,
),
),
)

assertThat(extras.getString(Constants.SIMPRINTS_SESSION_ID)).isEqualTo("sessionId")
assertThat(extras.getString(Constants.SIMPRINTS_VERIFICATION)).isEqualTo(
"""
{"guid":"guid","confidenceBand":"HIGH","confidence":50}
""".trimIndent(),
)
assertThat(extras.getBoolean(Constants.SIMPRINTS_BIOMETRICS_COMPLETE_CHECK)).isTrue()
}

@Test
fun `correctly maps exit form response`() {
val extras = mapper(
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ circleImageView_version = "3.1.0"
kermit_version = "2.0.5"
zip4j_version = "2.11.5"

libsimprints_version = "2025.1.2-SNAPSHOT"
libsimprints_version = "2025.1.3-SNAPSHOT"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to release SID using a snapshot libsimprints?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems so. At least the initial release, as per the Slack discussion.

simmatcher_version = "1.2.0"
roc_wrapper_version = "1.23.0"
roc_wrapper-v3_version = "3.1.0"
Expand Down