From 4132d0ca79f3c0e95e91f000e150b567540023cf Mon Sep 17 00:00:00 2001 From: Chris Poultney Date: Sat, 28 Jan 2023 21:03:58 +0000 Subject: [PATCH] Fixes mock usage error Bug: 253507223 Test: this is the test Change-Id: I1ef517660511aa52cf0721a90af5c4f8b9e7edb6 --- .../server/wallpaper/WallpaperManagerServiceTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java b/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java index de54537bbabe2..9b48114fafec4 100644 --- a/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java +++ b/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java @@ -201,7 +201,7 @@ public class WallpaperManagerServiceTests { public void setUp() { MockitoAnnotations.initMocks(this); - ExtendedMockito.doAnswer(invocation -> { + ExtendedMockito.doAnswer(invocation -> { int userId = (invocation.getArgument(0)); return getWallpaperTestDir(userId); }).when(() -> WallpaperUtils.getWallpaperDir(anyInt())); @@ -315,7 +315,8 @@ public class WallpaperManagerServiceTests { spyOn(mService.mWallpaperDisplayHelper); doReturn(true).when(mService.mWallpaperDisplayHelper) - .isUsableDisplay(any(Display.class), mService.mLastWallpaper.connection.mClientUid); + .isUsableDisplay(any(Display.class), + eq(mService.mLastWallpaper.connection.mClientUid)); mService.mLastWallpaper.connection.attachEngine(mock(IWallpaperEngine.class), DEFAULT_DISPLAY);