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:
Lucas Silva
2022-02-01 22:11:42 +00:00
parent 9b0862f268
commit 42e19912c8

View File

@@ -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);
}