diff options
author | bkchoi <bkchoi@google.com> | 2021-09-15 13:32:30 -0700 |
---|---|---|
committer | bkchoi <bkchoi@google.com> | 2021-09-16 08:51:18 -0700 |
commit | 76f14ca88895d791423c2e132c737b941dd7d658 (patch) | |
tree | 176f276b9f85ece94287443191e414568488c74a /tests/carservice_unit_test/src/com | |
parent | 4656979305120575d550cb5d0ae9a18637f0b386 (diff) | |
download | Car-76f14ca88895d791423c2e132c737b941dd7d658.tar.gz |
Specify the flags parameter for registerReceiver() calls.
Bug: 197675710
Test: atest CarServiceTest CarServiceUnitTest \
AndroidCarApiTest CarSecurityPermissionTest
Change-Id: I7dccc2635613b9014921f6779e6e5a4d635766c8
Diffstat (limited to 'tests/carservice_unit_test/src/com')
-rw-r--r-- | tests/carservice_unit_test/src/com/android/car/CarLocationServiceTest.java | 3 | ||||
-rw-r--r-- | tests/carservice_unit_test/src/com/android/car/user/CarUserNoticeServiceTest.java | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/carservice_unit_test/src/com/android/car/CarLocationServiceTest.java b/tests/carservice_unit_test/src/com/android/car/CarLocationServiceTest.java index 0a5614d240..149ad3ff8e 100644 --- a/tests/carservice_unit_test/src/com/android/car/CarLocationServiceTest.java +++ b/tests/carservice_unit_test/src/com/android/car/CarLocationServiceTest.java @@ -24,6 +24,7 @@ import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.fail; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.never; @@ -179,7 +180,7 @@ public class CarLocationServiceTest { ArgumentCaptor<IntentFilter> intentFilterArgument = ArgumentCaptor.forClass( IntentFilter.class); verify(mMockContext).registerReceiver(eq(mCarLocationService), - intentFilterArgument.capture()); + intentFilterArgument.capture(), anyInt()); verify(mMockCarDrivingStateService).registerDrivingStateChangeListener(any()); verify(mMockPerUserCarServiceHelper).registerServiceCallback(any()); IntentFilter intentFilter = intentFilterArgument.getValue(); diff --git a/tests/carservice_unit_test/src/com/android/car/user/CarUserNoticeServiceTest.java b/tests/carservice_unit_test/src/com/android/car/user/CarUserNoticeServiceTest.java index 412e2b187f..710b64d05d 100644 --- a/tests/carservice_unit_test/src/com/android/car/user/CarUserNoticeServiceTest.java +++ b/tests/carservice_unit_test/src/com/android/car/user/CarUserNoticeServiceTest.java @@ -138,7 +138,7 @@ public class CarUserNoticeServiceTest extends AbstractExtendedMockitoCarServiceT verify(mMockCarUserService).addUserLifecycleListener( mUserLifecycleListenerArgumentCaptor.capture()); verify(mMockContext).registerReceiver(mDisplayBroadcastReceiver.capture(), - any(IntentFilter.class)); + any(IntentFilter.class), anyInt()); verify(mCarPowerManager).setListener(mPowerStateListener.capture()); when(mMockContext.bindServiceAsUser(any(), any(), anyInt(), any())).thenReturn(true); doAnswer(invocation -> mIsKeyguardLocked) @@ -154,7 +154,7 @@ public class CarUserNoticeServiceTest extends AbstractExtendedMockitoCarServiceT CarUserNoticeService otherService = new CarUserNoticeService(mOtherMockContext); otherService.init(); - verify(mOtherMockContext, never()).registerReceiver(any(), any()); + verify(mOtherMockContext, never()).registerReceiver(any(), any(), anyInt()); } @Test |