Fix DreamBackendTest
In the test, getStringArray is currently returning null which is causing a null pointer exception. This only happens in testing when we mock Resources, and it cannot return null in prod. Test: atest SettingsLibRoboTests:DreamBackendTest Change-Id: I8d7e21e26d3d786fce977c530f7537c549a1b678
This commit is contained in:
@@ -57,6 +57,9 @@ public final class DreamBackendTest {
|
||||
when(res.getIntArray(
|
||||
com.android.internal.R.array.config_dreamComplicationsEnabledByDefault)).thenReturn(
|
||||
DEFAULT_DREAM_COMPLICATIONS);
|
||||
when(res.getStringArray(
|
||||
com.android.internal.R.array.config_disabledDreamComponents)).thenReturn(
|
||||
new String[]{});
|
||||
mBackend = new DreamBackend(mContext);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user