Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GMT+12 MOJURO TimeZone to ReportStream #16864

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 4 additions & 10 deletions frontend-react/src/utils/TemporarySettingsAPITypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ enum USTimeZone {
EAST_INDIANA = "EAST_INDIANA",
HAWAII = "HAWAII",
INDIANA_STARKE = "INDIANA_STARKE",
MAJURO = "MAJURO",
MICHIGAN = "MICHIGAN",
MOUNTAIN = "MOUNTAIN",
PACIFIC = "PACIFIC",
Expand Down Expand Up @@ -139,10 +140,7 @@ class SampleFilterObject extends SampleObject {

getAllEnums(): Map<string, string[]> {
return new Map<string, string[]>([
[
"Available Filters",
Array.from(Object.values(ReportStreamFilterDefinition)),
],
["Available Filters", Array.from(Object.values(ReportStreamFilterDefinition))],
]);
}

Expand Down Expand Up @@ -221,9 +219,7 @@ class SampleTranslationObj extends SampleObject {
schemaName = "schema";

getAllEnums(): Map<string, string[]> {
return new Map<string, string[]>([
["format", Array.from(Object.values(Format))],
]);
return new Map<string, string[]>([["format", Array.from(Object.values(Format))]]);
}

description(): string {
Expand Down Expand Up @@ -265,9 +261,7 @@ class SampleTransportObject extends SampleObject {
};

getAllEnums(): Map<string, string[]> {
return new Map<string, string[]>([
["GAEN.uuidFormat", Array.from(Object.values(GAENUUIDFormat))],
]);
return new Map<string, string[]>([["GAEN.uuidFormat", Array.from(Object.values(GAENUUIDFormat))]]);
}

description(): string {
Expand Down
3 changes: 3 additions & 0 deletions prime-router/src/main/kotlin/USTimeZone.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ enum class USTimeZone(val zoneId: String) {

// not technically a US time zone but we need it
UTC("UTC"),

// Marshall Island timezone (UTC+12)
MAJURO("Pacific/Majuro"),
}
8 changes: 8 additions & 0 deletions prime-router/src/test/kotlin/ReceiverTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package gov.cdc.prime.router
import assertk.assertThat
import assertk.assertions.isEqualTo
import assertk.assertions.isFalse
import assertk.assertions.isNotEqualTo
import assertk.assertions.isNull
import assertk.assertions.isTrue
import gov.cdc.prime.router.unittest.UnitTestUtils
Expand Down Expand Up @@ -273,4 +274,11 @@ internal class ReceiverTests {
val receiver = Receiver("elr", "IGNORE", Topic.COVID_19, CustomerStatus.INACTIVE, translatorConfig)
assertThat(receiver.transportType.type).isEqualTo("NULL")
}

@Test
fun `test MOJURO receiver timezone`() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: test name typo.

Also, why is it testing isNotEqualTo if it's creating a time in MHT and comparing it to what appears to be the same datetime?

Copy link
Collaborator Author

@oslynn oslynn Dec 23, 2024

Choose a reason for hiding this comment

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

Thank you very much, Andrew. It is fixed.

val shouldWork1 =
ZonedDateTime.of(2024, 12, 20, 0, 0, 0, 0, ZoneId.of(USTimeZone.MAJURO.zoneId)).toOffsetDateTime()
assertThat(shouldWork1).isNotEqualTo("2024-12-20T00:00+12:00")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this test actually testing? Is testing that it works or that it doesn't work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Test to see, it is working.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't it be testing that the date gets converted to MAJURO than?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yes, are you correct. I will test the date get converted to MAJURO as well. Thanks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added the test the date get converted to MAJURO. Done.

}
Loading