Skip to content

Commit

Permalink
Merge pull request #665 from Simprints/hotifx/identification-bundle-a…
Browse files Browse the repository at this point in the history
…rray-fix

Fix identification array bundle for LibSimprints integration
  • Loading branch information
luhmirin-s committed Apr 9, 2024
2 parents 86a4817 + 57733d1 commit 2c5a94a
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 2c5a94a

Please sign in to comment.