From 3e2917b91bc714df45fd5ea68f48fd219cc7ac60 Mon Sep 17 00:00:00 2001 From: Varun Shah Date: Sat, 12 Nov 2022 00:10:57 +0000 Subject: [PATCH] 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 --- .../fuelgauge/batterytip/AnomalyCleanupJobServiceTest.java | 3 ++- .../fuelgauge/batterytip/AnomalyConfigJobServiceTest.java | 3 ++- .../fuelgauge/batterytip/AnomalyDetectionJobServiceTest.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyCleanupJobServiceTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyCleanupJobServiceTest.java index 76a9b06688a..4c276ba00c1 100644 --- a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyCleanupJobServiceTest.java +++ b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyCleanupJobServiceTest.java @@ -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); } diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyConfigJobServiceTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyConfigJobServiceTest.java index c6aaa3240fb..3807be6a39b 100644 --- a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyConfigJobServiceTest.java +++ b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyConfigJobServiceTest.java @@ -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()); diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobServiceTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobServiceTest.java index dd90dc87d8e..faa3275e217 100644 --- a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobServiceTest.java +++ b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobServiceTest.java @@ -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);