From 84faaf8ec65501dfbd727afc4c74a39ccaf9d187 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Tue, 6 Nov 2018 14:15:54 -0800 Subject: Correct illegal mockito usage. According to the mockito FAQ use of thenReturn(mock(...)) is forbidden. This fixes that pattern in the setup for ZenModeFilteringTest. https://github.com/mockito/mockito/wiki/FAQ#can-i-thenreturn-an-inlined-mock- Test: runtest systemui-notification Bug: 119063276 Change-Id: Ic62b18063e5837240255e1dd0f5e0feb450f22cb --- .../src/com/android/server/notification/ZenModeFilteringTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/tests/uiservicestests/src/com/android/server/notification/ZenModeFilteringTest.java b/services/tests/uiservicestests/src/com/android/server/notification/ZenModeFilteringTest.java index c0bd7ccf6bf4..3c3c8ddc2b17 100644 --- a/services/tests/uiservicestests/src/com/android/server/notification/ZenModeFilteringTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/ZenModeFilteringTest.java @@ -70,7 +70,8 @@ public class ZenModeFilteringTest extends UiServiceTestCase { private NotificationRecord getNotificationRecord(NotificationChannel c) { StatusBarNotification sbn = mock(StatusBarNotification.class); - when(sbn.getNotification()).thenReturn(mock(Notification.class)); + Notification notification = mock(Notification.class); + when(sbn.getNotification()).thenReturn(notification); return new NotificationRecord(mContext, sbn, c); } -- cgit v1.2.3-59-g8ed1b