Use Mockito 4.6.1 API
Bug: 236636175
Test: m RunSettingsRoboTests
Change-Id: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
(cherry picked from commit c1c3a84fdc)
Merged-In: I2cfda684059520f6ddd1e72c55f1ab1ec9c99e8b
This commit is contained in:
@@ -21,8 +21,8 @@ import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.ArgumentMatchers.anyObject;
|
||||
import static org.mockito.Mockito.any;
|
||||
import static org.mockito.Mockito.anyInt;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
@@ -72,7 +72,7 @@ public class PrintJobMessagePreferenceControllerTest {
|
||||
mPreference = new Preference(mContext);
|
||||
when(mContext.getSystemService(Context.PRINT_SERVICE)).thenReturn(mPrintManager);
|
||||
when(mPrintManager.getGlobalPrintManagerForUser(anyInt())).thenReturn(mPrintManager);
|
||||
when(mPrintManager.getPrintJob(anyObject())).thenReturn(mPrintJob);
|
||||
when(mPrintManager.getPrintJob(any())).thenReturn(mPrintJob);
|
||||
when(mPrintJob.getInfo()).thenReturn(mPrintJobInfo);
|
||||
mController = new PrintJobMessagePreferenceController(mContext, PREF_KEY);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
||||
@@ -93,7 +93,7 @@ public class PrintJobMessagePreferenceControllerTest {
|
||||
|
||||
@Test
|
||||
public void updateUi_visiblePreference() {
|
||||
when(mPrintJobInfo.getStatus(anyObject())).thenReturn("TestPrint");
|
||||
when(mPrintJobInfo.getStatus(any())).thenReturn("TestPrint");
|
||||
mLifecycle.handleLifecycleEvent(ON_START);
|
||||
|
||||
assertThat(mPreference.isVisible()).isTrue();
|
||||
@@ -103,7 +103,7 @@ public class PrintJobMessagePreferenceControllerTest {
|
||||
|
||||
@Test
|
||||
public void updateUi_invisiblePreference() {
|
||||
when(mPrintJobInfo.getStatus(anyObject())).thenReturn(null);
|
||||
when(mPrintJobInfo.getStatus(any())).thenReturn(null);
|
||||
mLifecycle.handleLifecycleEvent(ON_START);
|
||||
|
||||
assertThat(mPreference.isVisible()).isFalse();
|
||||
|
||||
Reference in New Issue
Block a user