Fix JobSchedulerServiceTest.

JobScheduler expects the system gallery package to be non-null, so we
have to make sure the test context provides a non null value.

Bug: 146453470
Test: atest FrameworksMockingServicesTests:JobSchedulerServiceTest
Change-Id: Ib84567b006a2f57d17d767e0c08fd542576f979d
This commit is contained in:
Kweku Adams
2020-02-28 12:12:01 -08:00
parent 0a7ced1dd3
commit a3bc95e629

View File

@@ -107,6 +107,7 @@ public class JobSchedulerServiceTest {
.when(() -> LocalServices.getService(AppStandbyInternal.class));
doReturn(mock(UsageStatsManagerInternal.class))
.when(() -> LocalServices.getService(UsageStatsManagerInternal.class));
when(mContext.getString(anyInt())).thenReturn("some_test_string");
// Called in BackgroundJobsController constructor.
doReturn(mock(AppStateTracker.class))
.when(() -> LocalServices.getService(AppStateTracker.class));