Skip to content

Commit

Permalink
Fix identification array bundle for LibSimprints integration
Browse files Browse the repository at this point in the history
  • Loading branch information
luhmirin-s committed Apr 9, 2024
1 parent 86a4817 commit 57733d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ internal class LibSimprintsResponseMapper @Inject constructor() {
is ActionResponse.IdentifyActionResponse -> bundleOf(
Constants.SIMPRINTS_SESSION_ID to response.sessionId,
Constants.SIMPRINTS_BIOMETRICS_COMPLETE_CHECK to true,
Constants.SIMPRINTS_IDENTIFICATIONS to response.identifications
.map { Identification(it.guid, it.confidenceScore, Tier.valueOf(it.tier.name)) }
.toTypedArray(),
Constants.SIMPRINTS_IDENTIFICATIONS to ArrayList<Identification>(
response.identifications.map {
Identification(it.guid, it.confidenceScore, Tier.valueOf(it.tier.name))
}
),
).appendCoSyncData(response.eventsJson)

is ActionResponse.ConfirmActionResponse -> bundleOf(
Expand Down Expand Up @@ -97,6 +99,7 @@ internal class LibSimprintsResponseMapper @Inject constructor() {
}

companion object {

internal const val RESULT_CODE_OVERRIDE = "result_code_override"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,9 @@ class LibSimprintsResponseMapperTest {
)

assertThat(extras.getString(Constants.SIMPRINTS_SESSION_ID)).isEqualTo("sessionId")
assertThat(extras.getParcelableArray(Constants.SIMPRINTS_IDENTIFICATIONS)).isEqualTo(
arrayOf(
Identification("guid-1", 100, Tier.TIER_5),
Identification("guid-2", 75, Tier.TIER_3),
)
assertThat(extras.getParcelableArrayList<Identification>(Constants.SIMPRINTS_IDENTIFICATIONS)).containsExactly(
Identification("guid-1", 100, Tier.TIER_5),
Identification("guid-2", 75, Tier.TIER_3),
)
}

Expand Down

0 comments on commit 57733d1

Please sign in to comment.