From b51fa3a7079b4e65116a0b22e40451ee68406af0 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Thu, 6 Apr 2023 11:48:40 -0400 Subject: Fix some additional tests registering real receivers Test: atest SnoozeHelperTest Test: atest RoleObserverTest Test: with some temp logging in ContextImpl Fixes: 274705714 Change-Id: Id0352fd8d2aae47f588b47b3c45cdc5ed4e3fe3d --- .../tests/uiservicestests/src/com/android/server/UiServiceTestCase.java | 1 + .../src/com/android/server/notification/RoleObserverTest.java | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/services/tests/uiservicestests/src/com/android/server/UiServiceTestCase.java b/services/tests/uiservicestests/src/com/android/server/UiServiceTestCase.java index 82bc6f6c5263..06fc01738967 100644 --- a/services/tests/uiservicestests/src/com/android/server/UiServiceTestCase.java +++ b/services/tests/uiservicestests/src/com/android/server/UiServiceTestCase.java @@ -87,6 +87,7 @@ public class UiServiceTestCase { Mockito.doReturn(new Intent()).when(mContext).registerReceiverAsUser( any(), any(), any(), any(), any()); Mockito.doReturn(new Intent()).when(mContext).registerReceiver(any(), any()); + Mockito.doReturn(new Intent()).when(mContext).registerReceiver(any(), any(), anyInt()); Mockito.doNothing().when(mContext).unregisterReceiver(any()); } diff --git a/services/tests/uiservicestests/src/com/android/server/notification/RoleObserverTest.java b/services/tests/uiservicestests/src/com/android/server/notification/RoleObserverTest.java index b1a9f081253c..34bb664c9598 100644 --- a/services/tests/uiservicestests/src/com/android/server/notification/RoleObserverTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/RoleObserverTest.java @@ -96,8 +96,6 @@ public class RoleObserverTest extends UiServiceTestCase { private TestableNotificationManagerService mService; private NotificationManagerService.RoleObserver mRoleObserver; - private TestableContext mContext = spy(getContext()); - @Mock private PreferencesHelper mPreferencesHelper; @Mock -- cgit v1.2.3-59-g8ed1b