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 @@ -52,7 +52,7 @@ class BuildStepsUseCaseTest {
fun setup() {
MockKAnnotations.init(this)
useCase = BuildStepsUseCase(buildMatcherSubjectQuery, cache, mapStepsForLastBiometrics, fallbackToCommCareDataSourceIfNeeded)

// Setup fallback use case to return the input actions unchanged by default
coEvery { fallbackToCommCareDataSourceIfNeeded(any<ActionRequest.EnrolActionRequest>(), any()) } answers { firstArg() }
coEvery { fallbackToCommCareDataSourceIfNeeded(any<ActionRequest.IdentifyActionRequest>(), any()) } answers { firstArg() }
Expand Down Expand Up @@ -87,6 +87,7 @@ class BuildStepsUseCaseTest {
every { projectConfiguration.face?.allowedSDKs } returns listOf(FaceConfiguration.BioSdk.RANK_ONE)
every { projectConfiguration.face?.rankOne?.nbOfImagesToCapture } returns 3
every { projectConfiguration.face?.rankOne?.allowedAgeRange } returns null
every { projectConfiguration.face?.simFace?.allowedAgeRange } returns null

return projectConfiguration
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ fun ProjectConfiguration.canSyncBiometricDataToSimprints(): Boolean =
fun ProjectConfiguration.canSyncAnalyticsDataToSimprints(): Boolean =
synchronization.up.simprints.kind == UpSynchronizationConfiguration.UpSynchronizationKind.ONLY_ANALYTICS

fun ProjectConfiguration.isSimprintsEventDownSyncAllowed(): Boolean =
synchronization.down.simprints != null &&
fun ProjectConfiguration.isSimprintsEventDownSyncAllowed(): Boolean = synchronization.down.simprints != null &&
synchronization.down.simprints.frequency != Frequency.ONLY_PERIODICALLY_UP_SYNC

fun ProjectConfiguration.isCommCareEventDownSyncAllowed(): Boolean = synchronization.down.commCare != null
Expand All @@ -47,6 +46,7 @@ fun ProjectConfiguration.imagesUploadRequiresUnmeteredConnection(): Boolean = sy

fun ProjectConfiguration.allowedAgeRanges(): List<AgeGroup> = listOfNotNull(
face?.rankOne?.allowedAgeRange,
face?.simFace?.allowedAgeRange,
fingerprint?.secugenSimMatcher?.allowedAgeRange,
fingerprint?.nec?.allowedAgeRange,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class ProjectConfigurationTest {
val config = projectConfiguration.copy(
synchronization = synchronizationConfiguration.copy(
down = synchronizationConfiguration.down.copy(
simprints = null
simprints = null,
),
),
)
Expand All @@ -245,7 +245,7 @@ class ProjectConfigurationTest {
val config = projectConfiguration.copy(
synchronization = synchronizationConfiguration.copy(
down = synchronizationConfiguration.down.copy(
commCare = DownSynchronizationConfiguration.CommCareDownSynchronizationConfiguration
commCare = DownSynchronizationConfiguration.CommCareDownSynchronizationConfiguration,
),
),
)
Expand All @@ -258,7 +258,7 @@ class ProjectConfigurationTest {
val config = projectConfiguration.copy(
synchronization = synchronizationConfiguration.copy(
down = synchronizationConfiguration.down.copy(
commCare = null
commCare = null,
),
),
)
Expand Down Expand Up @@ -294,6 +294,7 @@ class ProjectConfigurationTest {
rankOne = faceConfiguration.rankOne?.copy(
allowedAgeRange = faceAgeRange,
),
simFace = null,
),
fingerprint = fingerprintConfiguration.copy(
secugenSimMatcher = fingerprintConfiguration.secugenSimMatcher?.copy(
Expand Down Expand Up @@ -428,7 +429,7 @@ class ProjectConfigurationTest {
AgeGroup(faceAgeRange.startInclusive, secugenSimMatcherAgeRange.startInclusive),
AgeGroup(secugenSimMatcherAgeRange.startInclusive, faceAgeRange.endExclusive),
AgeGroup(faceAgeRange.endExclusive!!, secugenSimMatcherAgeRange.endExclusive!!),
AgeGroup(secugenSimMatcherAgeRange.endExclusive!!, null),
AgeGroup(secugenSimMatcherAgeRange.endExclusive, null),
)

assertThat(result).isEqualTo(expected)
Expand Down