diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInsTransformer.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInsTransformer.kt index 3efe193a772..cbe0152a095 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInsTransformer.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInsTransformer.kt @@ -6,6 +6,7 @@ import de.rki.coronawarnapp.eventregistration.checkins.derivetime.deriveTime import de.rki.coronawarnapp.eventregistration.checkins.split.splitByMidnightUTC import de.rki.coronawarnapp.server.protocols.internal.pt.CheckInOuterClass import de.rki.coronawarnapp.server.protocols.internal.pt.TraceLocationOuterClass +import de.rki.coronawarnapp.server.protocols.internal.v2.RiskCalculationParametersOuterClass.TransmissionRiskValueMapping import de.rki.coronawarnapp.submission.Symptoms import de.rki.coronawarnapp.submission.task.TransmissionRiskVector import de.rki.coronawarnapp.submission.task.TransmissionRiskVectorDeterminator @@ -37,17 +38,17 @@ class CheckInsTransformer @Inject constructor( * @param symptoms [Symptoms] symptoms to calculate transmission risk level */ suspend fun transform(checkIns: List, symptoms: Symptoms): List { - - val submissionParamContainer = appConfigProvider + val presenceTracing = appConfigProvider .getAppConfig() .presenceTracing - .submissionParameters + val submissionParams = presenceTracing.submissionParameters + val trvMappings = presenceTracing.riskCalculationParameters.transmissionRiskValueMapping val transmissionVector = transmissionDeterminator.determine(symptoms) - + val now = timeStamper.nowUTC return checkIns.flatMap { originalCheckIn -> Timber.d("Transforming check-in=$originalCheckIn") - val derivedTimes = submissionParamContainer.deriveTime( + val derivedTimes = submissionParams.deriveTime( originalCheckIn.checkInStart.seconds, originalCheckIn.checkInEnd.seconds ) @@ -61,16 +62,32 @@ class CheckInsTransformer @Inject constructor( checkInStart = derivedTimes.startTimeSeconds.secondsToInstant(), checkInEnd = derivedTimes.endTimeSeconds.secondsToInstant() ) - derivedCheckIn.splitByMidnightUTC().map { checkIn -> - checkIn.toOuterCheckIn(transmissionVector) + + derivedCheckIn.splitByMidnightUTC().mapNotNull { checkIn -> + checkIn.toOuterCheckIn(now, transmissionVector, trvMappings) } } } } private fun CheckIn.toOuterCheckIn( - transmissionVector: TransmissionRiskVector - ): CheckInOuterClass.CheckIn { + now: Instant, + transmissionVector: TransmissionRiskVector, + trvMappings: List + ): CheckInOuterClass.CheckIn? { + val transmissionRiskLevel = determineRiskTransmission(now, transmissionVector) + + // Find transmissionRiskValue for matched transmissionRiskLevel - default 0.0 if no match + val transmissionRiskValue = trvMappings.find { + it.transmissionRiskLevel == transmissionRiskLevel + }?.transmissionRiskValue ?: 0.0 + + // Exclude check-in with TRV = 0.0 + if (transmissionRiskValue == 0.0) { + Timber.d("CheckIn has TRL=$transmissionRiskLevel is excluded from submission (TRV=0)") + return null // Not mapped + } + val signedTraceLocation = TraceLocationOuterClass.SignedTraceLocation.newBuilder() .setLocation(traceLocationBytes.toProtoByteString()) .setSignature(signature.toProtoByteString()) @@ -80,9 +97,7 @@ class CheckInsTransformer @Inject constructor( .setSignedLocation(signedTraceLocation) .setStartIntervalNumber(checkInStart.derive10MinutesInterval().toInt()) .setEndIntervalNumber(checkInEnd.derive10MinutesInterval().toInt()) - .setTransmissionRiskLevel( - determineRiskTransmission(timeStamper.nowUTC, transmissionVector) - ) + .setTransmissionRiskLevel(transmissionRiskLevel) .build() } } diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/split/CheckInSplitter.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/split/CheckInSplitter.kt index e423c0945fc..c9f04c6f2b5 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/split/CheckInSplitter.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/eventregistration/checkins/split/CheckInSplitter.kt @@ -82,8 +82,8 @@ private fun Long.isLastDay(days: Long): Boolean { } private fun List.print() = Timber.i( - "splitInto: %s", - joinToString(separator = "\n") { checkIn -> + "SplitCheckIns=[%s]", + joinToString(separator = ",\n") { checkIn -> "{checkInStart=%s,checkOutEnd=%s}".format( checkIn.checkInStart, checkIn.checkInEnd diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/attendee/scan/ScanCheckInQrCodeFragment.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/attendee/scan/ScanCheckInQrCodeFragment.kt index 8e1ee327a92..1b7e90e6585 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/attendee/scan/ScanCheckInQrCodeFragment.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/attendee/scan/ScanCheckInQrCodeFragment.kt @@ -50,7 +50,8 @@ class ScanCheckInQrCodeFragment : checkInQrCodeScanTorch.setOnCheckedChangeListener { _, isChecked -> binding.checkInQrCodeScanPreview.setTorch(isChecked) } - checkInQrCodeScanClose.setOnClickListener { viewModel.onNavigateUp() } + + checkInQrCodeScanToolbar.setNavigationOnClickListener { viewModel.onNavigateUp() } checkInQrCodeScanPreview.decoderFactory = DefaultDecoderFactory(listOf(BarcodeFormat.QR_CODE)) checkInQrCodeScanViewfinderView.setCameraPreview(binding.checkInQrCodeScanPreview) } diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/submission/qrcode/scan/SubmissionQRCodeScanFragment.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/submission/qrcode/scan/SubmissionQRCodeScanFragment.kt index e3659a896f9..6a26df16cb3 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/submission/qrcode/scan/SubmissionQRCodeScanFragment.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/submission/qrcode/scan/SubmissionQRCodeScanFragment.kt @@ -45,20 +45,22 @@ class SubmissionQRCodeScanFragment : override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - binding.submissionQrCodeScanTorch.setOnCheckedChangeListener { _, isChecked -> - binding.submissionQrCodeScanPreview.setTorch( - isChecked - ) - } + with(binding) { + submissionQrCodeScanTorch.setOnCheckedChangeListener { _, isChecked -> + binding.submissionQrCodeScanPreview.setTorch( + isChecked + ) + } - binding.submissionQrCodeScanClose.setOnClickListener { - viewModel.onClosePressed() - } + submissionQrCodeScanToolbar.setNavigationOnClickListener { + viewModel.onClosePressed() + } - binding.submissionQrCodeScanPreview.decoderFactory = - DefaultDecoderFactory(listOf(BarcodeFormat.QR_CODE)) + submissionQrCodeScanPreview.decoderFactory = + DefaultDecoderFactory(listOf(BarcodeFormat.QR_CODE)) - binding.submissionQrCodeScanViewfinderView.setCameraPreview(binding.submissionQrCodeScanPreview) + submissionQrCodeScanViewfinderView.setCameraPreview(binding.submissionQrCodeScanPreview) + } viewModel.scanStatusValue.observe2(this) { if (ScanStatus.INVALID == it) { diff --git a/Corona-Warn-App/src/main/res/layout/fragment_scan_check_in_qr_code.xml b/Corona-Warn-App/src/main/res/layout/fragment_scan_check_in_qr_code.xml index b14d08f71b9..80845bfcf21 100644 --- a/Corona-Warn-App/src/main/res/layout/fragment_scan_check_in_qr_code.xml +++ b/Corona-Warn-App/src/main/res/layout/fragment_scan_check_in_qr_code.xml @@ -4,7 +4,7 @@ android:id="@+id/check_in_qr_code_scan_container" android:layout_width="match_parent" android:layout_height="match_parent" - android:contentDescription="@string/submission_qr_code_scan_title" + android:contentDescription="@string/qr_code_scan_body" android:transitionName="shared_element_container"> + app:zxing_framing_rect_height="@dimen/scan_qr_code_viewfinder_size" + app:zxing_framing_rect_width="@dimen/scan_qr_code_viewfinder_size"> @@ -28,62 +28,45 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" + app:zxing_viewfinder_mask="@color/colorQrCodeScanMask" app:zxing_viewfinder_laser_visibility="false" /> - - - + - + - - - + - - \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/layout/fragment_submission_qr_code_scan.xml b/Corona-Warn-App/src/main/res/layout/fragment_submission_qr_code_scan.xml index cba9a2bb359..2067ff633f6 100644 --- a/Corona-Warn-App/src/main/res/layout/fragment_submission_qr_code_scan.xml +++ b/Corona-Warn-App/src/main/res/layout/fragment_submission_qr_code_scan.xml @@ -1,113 +1,87 @@ - + android:id="@+id/submission_qr_code_scan_container" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:contentDescription="@string/qr_code_scan_body"> - - - - - + - + - + - + + - - - - - + - - + android:textOn="" /> - + - + - - \ No newline at end of file + \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/values-de/strings.xml b/Corona-Warn-App/src/main/res/values-de/strings.xml index 0032107c972..0f81d2553fb 100644 --- a/Corona-Warn-App/src/main/res/values-de/strings.xml +++ b/Corona-Warn-App/src/main/res/values-de/strings.xml @@ -1000,9 +1000,9 @@ "Abbrechen" - "Positionieren Sie den QR-Code in den Rahmen." + "QR-Code Scan" - "Positionieren Sie den QR-Code in den Rahmen." + "Positionieren Sie den QR-Code in den Rahmen." diff --git a/Corona-Warn-App/src/main/res/values-night/colors.xml b/Corona-Warn-App/src/main/res/values-night/colors.xml index 4968d680946..5048bc35d9f 100644 --- a/Corona-Warn-App/src/main/res/values-night/colors.xml +++ b/Corona-Warn-App/src/main/res/values-night/colors.xml @@ -73,4 +73,7 @@ #434445 #000000 + + #FFFFFF + #BF000000 diff --git a/Corona-Warn-App/src/main/res/values/colors.xml b/Corona-Warn-App/src/main/res/values/colors.xml index 5664ee9df9e..0fbe04067f6 100644 --- a/Corona-Warn-App/src/main/res/values/colors.xml +++ b/Corona-Warn-App/src/main/res/values/colors.xml @@ -95,6 +95,10 @@ #F5F5F5 + + #000000 + #BFFFFFFF + #EB4D3D diff --git a/Corona-Warn-App/src/main/res/values/dimens.xml b/Corona-Warn-App/src/main/res/values/dimens.xml index 5a07565d1eb..5dfb514085d 100644 --- a/Corona-Warn-App/src/main/res/values/dimens.xml +++ b/Corona-Warn-App/src/main/res/values/dimens.xml @@ -118,9 +118,9 @@ 6dp 16dp - - 240dp - 120dp + + 300dp + 150dp 40dp diff --git a/Corona-Warn-App/src/main/res/values/strings.xml b/Corona-Warn-App/src/main/res/values/strings.xml index 1e67ae2a1f1..04a964dc388 100644 --- a/Corona-Warn-App/src/main/res/values/strings.xml +++ b/Corona-Warn-App/src/main/res/values/strings.xml @@ -1008,8 +1008,12 @@ "Cancel" - "Position the QR code in the frame." + "QR-Code Scan" + "Position the QR code in the frame." + + + "QR-Code Scan" "Position the QR code in the frame." diff --git a/Corona-Warn-App/src/main/res/values/styles.xml b/Corona-Warn-App/src/main/res/values/styles.xml index 29a4b90e1d6..dfb4d908eef 100644 --- a/Corona-Warn-App/src/main/res/values/styles.xml +++ b/Corona-Warn-App/src/main/res/values/styles.xml @@ -391,11 +391,11 @@ - diff --git a/Corona-Warn-App/src/test/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInsTransformerTest.kt b/Corona-Warn-App/src/test/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInsTransformerTest.kt index dece5cb7e0a..b019032dfff 100644 --- a/Corona-Warn-App/src/test/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInsTransformerTest.kt +++ b/Corona-Warn-App/src/test/java/de/rki/coronawarnapp/eventregistration/checkins/CheckInsTransformerTest.kt @@ -4,13 +4,13 @@ import com.google.protobuf.ByteString import de.rki.coronawarnapp.appconfig.AppConfigProvider import de.rki.coronawarnapp.appconfig.ConfigData import de.rki.coronawarnapp.appconfig.PresenceTracingConfigContainer +import de.rki.coronawarnapp.appconfig.PresenceTracingRiskCalculationParamContainer import de.rki.coronawarnapp.appconfig.PresenceTracingSubmissionParamContainer import de.rki.coronawarnapp.server.protocols.internal.pt.TraceLocationOuterClass -import de.rki.coronawarnapp.server.protocols.internal.v2 - .PresenceTracingParametersOuterClass.PresenceTracingSubmissionParameters.DurationFilter -import de.rki.coronawarnapp.server.protocols.internal.v2 - .PresenceTracingParametersOuterClass.PresenceTracingSubmissionParameters.AerosoleDecayFunctionLinear -import de.rki.coronawarnapp.server.protocols.internal.v2.RiskCalculationParametersOuterClass +import de.rki.coronawarnapp.server.protocols.internal.v2.PresenceTracingParametersOuterClass.PresenceTracingSubmissionParameters.DurationFilter +import de.rki.coronawarnapp.server.protocols.internal.v2.PresenceTracingParametersOuterClass.PresenceTracingSubmissionParameters.AerosoleDecayFunctionLinear +import de.rki.coronawarnapp.server.protocols.internal.v2.RiskCalculationParametersOuterClass.Range +import de.rki.coronawarnapp.server.protocols.internal.v2.RiskCalculationParametersOuterClass.TransmissionRiskValueMapping import de.rki.coronawarnapp.submission.Symptoms import de.rki.coronawarnapp.submission.task.TransmissionRiskVectorDeterminator import de.rki.coronawarnapp.util.TimeAndDateExtensions.seconds @@ -94,21 +94,21 @@ class CheckInsTransformerTest : BaseTest() { description = "restaurant_3", address = "address_3", traceLocationStart = Instant.parse("2021-03-04T09:00:00Z"), - traceLocationEnd = Instant.parse("2021-03-06T11:00:00Z"), + traceLocationEnd = Instant.parse("2021-03-10T11:00:00Z"), defaultCheckInLengthInMinutes = 10, traceLocationBytes = TRACE_LOCATION_3.decodeBase64()!!, signature = "c2lnbmF0dXJlMQ==".decodeBase64()!!, checkInStart = Instant.parse("2021-03-04T09:30:00Z"), - checkInEnd = Instant.parse("2021-03-06T09:45:00Z"), + checkInEnd = Instant.parse("2021-03-10T09:45:00Z"), completed = false, createJournalEntry = false ) - private val presenceTracingConfig = PresenceTracingSubmissionParamContainer( + private val submissionParams = PresenceTracingSubmissionParamContainer( durationFilters = listOf( DurationFilter.newBuilder() .setDropIfMinutesInRange( - RiskCalculationParametersOuterClass.Range.newBuilder() + Range.newBuilder() .setMin(0.0) .setMax(10.0) .setMaxExclusive(true) @@ -119,7 +119,7 @@ class CheckInsTransformerTest : BaseTest() { aerosoleDecayLinearFunctions = listOf( AerosoleDecayFunctionLinear.newBuilder() .setMinutesRange( - RiskCalculationParametersOuterClass.Range.newBuilder() + Range.newBuilder() .setMin(0.0) .setMax(30.0) .build() @@ -129,7 +129,7 @@ class CheckInsTransformerTest : BaseTest() { .build(), AerosoleDecayFunctionLinear.newBuilder() .setMinutesRange( - RiskCalculationParametersOuterClass.Range.newBuilder() + Range.newBuilder() .setMin(30.0) .setMax(9999.0) .setMinExclusive(true) @@ -141,15 +141,42 @@ class CheckInsTransformerTest : BaseTest() { ) ) + private val transmissionRiskValueMappings: List = listOf( + TransmissionRiskValueMapping.newBuilder() + .setTransmissionRiskLevel(1) + .setTransmissionRiskValue(2.0) + .build(), + TransmissionRiskValueMapping.newBuilder() + .setTransmissionRiskLevel(2) + .setTransmissionRiskValue(2.0) + .build(), + TransmissionRiskValueMapping.newBuilder() + .setTransmissionRiskLevel(4) + .setTransmissionRiskValue(2.0) + .build(), + TransmissionRiskValueMapping.newBuilder() + .setTransmissionRiskLevel(6) + .setTransmissionRiskValue(0.0) // CheckIn will be excluded ,as TRV here = 0 + .build(), + // No transmissionMapping for TRL = 7 and therefore one of the check-ins is excluded + TransmissionRiskValueMapping.newBuilder() + .setTransmissionRiskLevel(8) + .setTransmissionRiskValue(2.0) + .build() + ) + @BeforeEach fun setup() { MockKAnnotations.init(this) - every { timeStamper.nowUTC } returns Instant.parse("2021-03-08T10:00:00Z") + every { timeStamper.nowUTC } returns Instant.parse("2021-03-11T10:00:00Z") every { symptoms.symptomIndication } returns Symptoms.Indication.POSITIVE every { symptoms.startOfSymptoms } returns Symptoms.StartOf.Date(timeStamper.nowUTC.toLocalDate()) coEvery { appConfigProvider.getAppConfig() } returns mockk().apply { every { presenceTracing } returns PresenceTracingConfigContainer( - submissionParameters = presenceTracingConfig + submissionParameters = submissionParams, + riskCalculationParameters = PresenceTracingRiskCalculationParamContainer( + transmissionRiskValueMapping = transmissionRiskValueMappings + ) ) } checkInTransformer = CheckInsTransformer( @@ -171,7 +198,7 @@ class CheckInsTransformerTest : BaseTest() { ) with(outCheckIns) { - size shouldBe 4 + size shouldBe 6 // 3 check-ins with TRL = 1 and 3 other check-ins with TRL = 2, 4, 8 // Check In 1 is excluded from submission due to time deriving // Check In 2 mapping and transformation get(0).apply { @@ -208,7 +235,7 @@ class CheckInsTransformerTest : BaseTest() { startTimestamp shouldBe 0 endTimestamp shouldBe 0 defaultCheckInLengthInMinutes shouldBe 0 - transmissionRiskLevel shouldBe 4 + transmissionRiskLevel shouldBe 1 } } @@ -222,12 +249,12 @@ class CheckInsTransformerTest : BaseTest() { description = "restaurant_3", address = "address_3", traceLocationStart = Instant.parse("2021-03-04T09:00:00Z"), - traceLocationEnd = Instant.parse("2021-03-06T11:00:00Z"), + traceLocationEnd = Instant.parse("2021-03-10T11:00:00Z") defaultCheckInLengthInMinutes = 10, traceLocationBytes = EMPTY, signature = "c2lnbmF0dXJlMQ==".decodeBase64()!!, checkInStart = Instant.parse("2021-03-04T09:30:00Z"), - checkInEnd = Instant.parse("2021-03-06T09:45:00Z"), + checkInEnd = Instant.parse("2021-03-10T09:45:00Z"), completed = false, // Not mapped - client specific createJournalEntry = false // Not mapped - client specific */ @@ -246,9 +273,9 @@ class CheckInsTransformerTest : BaseTest() { description shouldBe "restaurant_3" address shouldBe "address_3" startTimestamp shouldBe Instant.parse("2021-03-04T09:00:00Z").seconds - endTimestamp shouldBe Instant.parse("2021-03-06T11:00:00Z").seconds + endTimestamp shouldBe Instant.parse("2021-03-10T11:00:00Z").seconds defaultCheckInLengthInMinutes shouldBe 10 - transmissionRiskLevel shouldBe 4 + transmissionRiskLevel shouldBe 1 } } @@ -266,9 +293,9 @@ class CheckInsTransformerTest : BaseTest() { description shouldBe "restaurant_3" address shouldBe "address_3" startTimestamp shouldBe Instant.parse("2021-03-04T09:00:00Z").seconds - endTimestamp shouldBe Instant.parse("2021-03-06T11:00:00Z").seconds + endTimestamp shouldBe Instant.parse("2021-03-10T11:00:00Z").seconds defaultCheckInLengthInMinutes shouldBe 10 - transmissionRiskLevel shouldBe 6 + transmissionRiskLevel shouldBe 1 } } @@ -277,7 +304,47 @@ class CheckInsTransformerTest : BaseTest() { // Start time from splitted check-in 3 startIntervalNumber shouldBe Instant.parse("2021-03-06T00:00:00Z").seconds / TEN_MINUTES_IN_SECONDS // End time for splitted check-in 3 - endIntervalNumber shouldBe Instant.parse("2021-03-06T10:20:00Z").seconds / TEN_MINUTES_IN_SECONDS + endIntervalNumber shouldBe Instant.parse("2021-03-07T00:00:00Z").seconds / TEN_MINUTES_IN_SECONDS + signedLocation.signature shouldBe ByteString.copyFrom("signature1".toByteArray()) + parseLocation(signedLocation.location).apply { + guid shouldBe "trace_location_3" + version shouldBe 1 + type shouldBe TraceLocationOuterClass.TraceLocationType.LOCATION_TYPE_PERMANENT_RETAIL + description shouldBe "restaurant_3" + address shouldBe "address_3" + startTimestamp shouldBe Instant.parse("2021-03-04T09:00:00Z").seconds + endTimestamp shouldBe Instant.parse("2021-03-10T11:00:00Z").seconds + defaultCheckInLengthInMinutes shouldBe 10 + transmissionRiskLevel shouldBe 2 + } + } + + // Splitted CheckIn 4 + get(4).apply { + // Start time from splitted check-in 4 + startIntervalNumber shouldBe Instant.parse("2021-03-07T00:00:00Z").seconds / TEN_MINUTES_IN_SECONDS + // End time for splitted check-in 4 + endIntervalNumber shouldBe Instant.parse("2021-03-08T00:00:00Z").seconds / TEN_MINUTES_IN_SECONDS + signedLocation.signature shouldBe ByteString.copyFrom("signature1".toByteArray()) + parseLocation(signedLocation.location).apply { + guid shouldBe "trace_location_3" + version shouldBe 1 + type shouldBe TraceLocationOuterClass.TraceLocationType.LOCATION_TYPE_PERMANENT_RETAIL + description shouldBe "restaurant_3" + address shouldBe "address_3" + startTimestamp shouldBe Instant.parse("2021-03-04T09:00:00Z").seconds + endTimestamp shouldBe Instant.parse("2021-03-10T11:00:00Z").seconds + defaultCheckInLengthInMinutes shouldBe 10 + transmissionRiskLevel shouldBe 4 + } + } + + // Splitted CheckIn 5 + get(5).apply { + // Start time from splitted check-in 5 + startIntervalNumber shouldBe Instant.parse("2021-03-10T00:00:00Z").seconds / TEN_MINUTES_IN_SECONDS + // End time for splitted check-in 5 + endIntervalNumber shouldBe Instant.parse("2021-03-10T10:20:00Z").seconds / TEN_MINUTES_IN_SECONDS signedLocation.signature shouldBe ByteString.copyFrom("signature1".toByteArray()) parseLocation(signedLocation.location).apply { guid shouldBe "trace_location_3" @@ -286,9 +353,9 @@ class CheckInsTransformerTest : BaseTest() { description shouldBe "restaurant_3" address shouldBe "address_3" startTimestamp shouldBe Instant.parse("2021-03-04T09:00:00Z").seconds - endTimestamp shouldBe Instant.parse("2021-03-06T11:00:00Z").seconds + endTimestamp shouldBe Instant.parse("2021-03-10T11:00:00Z").seconds defaultCheckInLengthInMinutes shouldBe 10 - transmissionRiskLevel shouldBe 7 + transmissionRiskLevel shouldBe 8 } } } @@ -304,6 +371,6 @@ class CheckInsTransformerTest : BaseTest() { private const val TRACE_LOCATION_2 = "ChB0cmFjZV9sb2NhdGlvbl8yEAEYAiIMcmVzdGF1cmFudF8yKglhZGRyZXNzXzI=" private const val TRACE_LOCATION_3 = - "ChB0cmFjZV9sb2NhdGlvbl8zEAEYAyIMcmVzdGF1cmFudF8zKglhZGRyZXNzXzMwkMOCggY4sMGNggZACg==" + "ChB0cmFjZV9sb2NhdGlvbl8zEAEYAyIMcmVzdGF1cmFudF8zKglhZGRyZXNzXzMwkMOCggY4sM2iggZACg==" } }