resolve merge conflicts of 7d9233302f to sc-dev

Change-Id: I7f6b7b035cc9c37a168e97ddeac5c8de9d5910de
This commit is contained in:
Almaz Mingaleev
2021-03-30 11:43:07 +00:00
6 changed files with 60 additions and 20 deletions

View File

@@ -92,4 +92,23 @@ public class TimeZoneDataTest {
.containsExactly("US", "GB");
assertThat(timeZoneData.lookupCountryCodesForZoneId("Unknown/Secret_City2")).isEmpty();
}
@Test
public void lookupCountryCodesForNonCanonicalZoneId_returnsCurrentZone() {
TimeZoneData timeZoneData = new TimeZoneData(mCountryZonesFinder);
CountryTimeZones greenland = mock(CountryTimeZones.class);
when(greenland.getCountryIso()).thenReturn("gl");
when(greenland.getTimeZoneMappings()).thenReturn(Arrays.asList(
TimeZoneMapping.createForTests(
"America/Nuuk",
true /* showInPicker */,
null /* notUsedAfter */,
Arrays.asList("America/Godthab"))));
when(mCountryZonesFinder.lookupCountryTimeZonesForZoneId("America/Godthab"))
.thenReturn(Arrays.asList(greenland));
assertThat(timeZoneData.lookupCountryCodesForZoneId("America/Godthab"))
.containsExactly("GL");
}
}