From d1c4ea906f22c07b9912b3857c5b6fe50983943e Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Mon, 20 Jul 2020 11:26:14 +0100 Subject: [PATCH] Track core platform API change This commit tracks changes in libcore to extend the IDs recognized to be associated with a country. Bug: 155738410 Test: treehugger Change-Id: I0d75b6c41cdce4a373f73761ccd2d7db357d6548 --- .../datetime/timezone/model/TimeZoneDataTest.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/robotests/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java b/tests/robotests/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java index 6322b57e979..1acbcda0ae6 100644 --- a/tests/robotests/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java +++ b/tests/robotests/src/com/android/settings/datetime/timezone/model/TimeZoneDataTest.java @@ -21,6 +21,8 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import static java.util.Collections.emptyList; + import com.android.i18n.timezone.CountryTimeZones; import com.android.i18n.timezone.CountryTimeZones.TimeZoneMapping; import com.android.i18n.timezone.CountryZonesFinder; @@ -49,7 +51,7 @@ public class TimeZoneDataTest { public void testRegionsWithTimeZone() { TimeZoneData timeZoneData = new TimeZoneData(mCountryZonesFinder); CountryTimeZones countryTimeZones = mock(CountryTimeZones.class); - when(countryTimeZones.getTimeZoneMappings()).thenReturn(Collections.emptyList()); + when(countryTimeZones.getTimeZoneMappings()).thenReturn(emptyList()); when(mCountryZonesFinder.lookupCountryTimeZones("US")).thenReturn(countryTimeZones); assertThat(timeZoneData.lookupCountryTimeZones("US").getCountryTimeZones()) .isSameAs(countryTimeZones); @@ -57,7 +59,7 @@ public class TimeZoneDataTest { @Test public void testGetRegionIds() { - when(mCountryZonesFinder.lookupAllCountryIsoCodes()).thenReturn(Collections.emptyList()); + when(mCountryZonesFinder.lookupAllCountryIsoCodes()).thenReturn(emptyList()); TimeZoneData timeZoneData = new TimeZoneData(mCountryZonesFinder); assertThat(timeZoneData.getRegionIds()).isEmpty(); @@ -73,13 +75,16 @@ public class TimeZoneDataTest { CountryTimeZones US = mock(CountryTimeZones.class); when(US.getCountryIso()).thenReturn("us"); when(US.getTimeZoneMappings()).thenReturn(Arrays.asList( - TimeZoneMapping.createForTests("Unknown/Secret_City", true, null /* notUsedAfter */), - TimeZoneMapping.createForTests("Unknown/Secret_City2", false, null /* notUsedAfter */) + TimeZoneMapping.createForTests( + "Unknown/Secret_City", true, null /* notUsedAfter */, emptyList()), + TimeZoneMapping.createForTests( + "Unknown/Secret_City2", false, null /* notUsedAfter */, emptyList()) )); CountryTimeZones GB = mock(CountryTimeZones.class); when(GB.getCountryIso()).thenReturn("gb"); when(GB.getTimeZoneMappings()).thenReturn(Collections.singletonList( - TimeZoneMapping.createForTests("Unknown/Secret_City", true, null /* notUsedAfter */) + TimeZoneMapping.createForTests( + "Unknown/Secret_City", true, null /* notUsedAfter */, emptyList()) )); when(mCountryZonesFinder.lookupCountryTimeZonesForZoneId("Unknown/Secret_City")) .thenReturn(Arrays.asList(US, GB));