Fix assertion in VisibilityPreferenceControllerTest.
The test was asserting that VISIBILIY_NO_OVERRIDE (an int) is not contained in a List<String> (*), which is (trivially) true but doesn't test what the test intends to test. (*) or a List<CharSequence>, which is similarly wrong / meaningless, prior to the base CL http://ag/3345932 VisibilityPreferenceController uses Integer.toString() to construct corresponding String values, so the test should be checking for that String value. For consistency with testUpdateState_noGlobalRestriction() this CL uses the equivalent (and slightly shorter) String.valueOf(int) instead of Integer.toString(). Test: EXPERIMENTAL_USE_OPENJDK9=1.8 make RunSettingsRoboTests \ ROBOTEST_FILTER=VisibilityPreferenceControllerTest Change-Id: I48644729d3e0f29d7ffcc981aeef650f2b1426ef
This commit is contained in:
@@ -209,7 +209,7 @@ public class VisibilityPreferenceControllerTest {
|
|||||||
ArgumentCaptor.forClass(CharSequence[].class);
|
ArgumentCaptor.forClass(CharSequence[].class);
|
||||||
verify(pref, times(1)).setEntryValues(argumentCaptor.capture());
|
verify(pref, times(1)).setEntryValues(argumentCaptor.capture());
|
||||||
assertFalse(toStringList(argumentCaptor.getValue())
|
assertFalse(toStringList(argumentCaptor.getValue())
|
||||||
.contains(VISIBILITY_NO_OVERRIDE));
|
.contains(String.valueOf(VISIBILITY_NO_OVERRIDE)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -228,7 +228,7 @@ public class VisibilityPreferenceControllerTest {
|
|||||||
ArgumentCaptor.forClass(CharSequence[].class);
|
ArgumentCaptor.forClass(CharSequence[].class);
|
||||||
verify(pref, times(1)).setEntryValues(argumentCaptor.capture());
|
verify(pref, times(1)).setEntryValues(argumentCaptor.capture());
|
||||||
assertFalse(toStringList(argumentCaptor.getValue())
|
assertFalse(toStringList(argumentCaptor.getValue())
|
||||||
.contains(VISIBILITY_NO_OVERRIDE));
|
.contains(String.valueOf(VISIBILITY_NO_OVERRIDE)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user