Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42e19912 authored by Lucas Silva's avatar Lucas Silva
Browse files

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
parent 9b0862f2
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -57,6 +57,9 @@ public final class DreamBackendTest {
        when(res.getIntArray(
        when(res.getIntArray(
                com.android.internal.R.array.config_dreamComplicationsEnabledByDefault)).thenReturn(
                com.android.internal.R.array.config_dreamComplicationsEnabledByDefault)).thenReturn(
                DEFAULT_DREAM_COMPLICATIONS);
                DEFAULT_DREAM_COMPLICATIONS);
        when(res.getStringArray(
                com.android.internal.R.array.config_disabledDreamComponents)).thenReturn(
                new String[]{});
        mBackend = new DreamBackend(mContext);
        mBackend = new DreamBackend(mContext);
    }
    }