Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e53ad62 authored by Chandru S's avatar Chandru S
Browse files

Switch the mocking session strictness to WARN from STRICT KeyguardUpdateMonitorTest

The stubbing is not great in this test, not all flows are stubbed out properly,
if a device is not provisioned when the test runs, mockito complains quite a bit
about either unmatched stubs or unnecessary stubbing.

Bug: 277873197
Test: atest KeyguardUpdateMonitorTest
Test: force mDeviceProvisioned flag to false in KeyguardUpdateMonitor
      run the test, it should not fail
Change-Id: I5adf4e50e1fa93807dc2e6bab53ddc78963605f6
parent e3c89655
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.MockitoSession;
import org.mockito.internal.util.reflection.FieldSetter;
import org.mockito.quality.Strictness;

import java.util.ArrayList;
import java.util.Arrays;
@@ -303,6 +304,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {

        mMockitoSession = ExtendedMockito.mockitoSession()
                .spyStatic(SubscriptionManager.class)
                .strictness(Strictness.WARN)
                .startMocking();
        ExtendedMockito.doReturn(SubscriptionManager.INVALID_SUBSCRIPTION_ID)
                .when(SubscriptionManager::getDefaultSubscriptionId);