Update AnomalyJobServiceTests.

Update the JobSchedulerImpl constructor for the related tests,
specifcally Cleanup, Config, and Detection.

Bug: 255371817
Test: make -j RunSettingsRoboTests ROBOTTEST_FILTER="AnomalyCleanupJobServiceTest|AnomalyConfigJobServiceTest|AnomalyDetectionJobServiceTest"
Change-Id: I53ccfffc278a60f4b109169fde6675cee34e5fd0
This commit is contained in:
Varun Shah
2022-11-12 00:10:57 +00:00
parent b33256a0fc
commit 3e2917b91b
3 changed files with 6 additions and 3 deletions

View File

@@ -71,7 +71,8 @@ public class AnomalyCleanupJobServiceTest {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mJobScheduler = spy(new JobSchedulerImpl(IJobScheduler.Stub.asInterface(new Binder())));
mJobScheduler = spy(new JobSchedulerImpl(mContext,
IJobScheduler.Stub.asInterface(new Binder())));
when(mContext.getSystemService(JobScheduler.class)).thenReturn(mJobScheduler);
}

View File

@@ -69,7 +69,8 @@ public class AnomalyConfigJobServiceTest {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mJobScheduler = spy(new JobSchedulerImpl(IJobScheduler.Stub.asInterface(new Binder())));
mJobScheduler = spy(new JobSchedulerImpl(mContext,
IJobScheduler.Stub.asInterface(new Binder())));
when(mContext.getSystemService(JobScheduler.class)).thenReturn(mJobScheduler);
mJobService = spy(new AnomalyConfigJobService());

View File

@@ -113,7 +113,8 @@ public class AnomalyDetectionJobServiceTest {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mJobScheduler = spy(new JobSchedulerImpl(IJobScheduler.Stub.asInterface(new Binder())));
mJobScheduler = spy(new JobSchedulerImpl(mContext,
IJobScheduler.Stub.asInterface(new Binder())));
when(mContext.getSystemService(JobScheduler.class)).thenReturn(mJobScheduler);
mPolicy = new BatteryTipPolicy(mContext);