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

Commit 26f170a9 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

Remove updateConnectivity_notAvailable_notCalled

Which for verifying displayPreference not call, but actually called it
in test, does not make sense.

Bug: 324862928
Test: atest WifiMacAddressPreferenceControllerTest
Change-Id: I04a47de75cc8ceeb12cad3d79c28e350b6b391fd
parent 87a5ae0c
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -20,9 +20,7 @@ import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;

import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;

import android.annotation.SuppressLint;
import android.content.Context;
@@ -93,19 +91,6 @@ public class WifiMacAddressPreferenceControllerTest {
                .asList().containsAtLeastElementsIn(expectedIntents);
    }

    @Test
    public void updateConnectivity_notAvailable_notCalled() {
        boolean mCalled = false;
        mController = spy(new ConcreteWifiMacAddressPreferenceController(mContext, mLifecycle) {
            @Override
            public boolean isAvailable() {
                return false;
            }
        });
        mController.displayPreference(mScreen);
        verify(mController, never()).updateConnectivity();
    }

    @Test
    public void updateConnectivity_null_setMacUnavailable() {
        doReturn(null).when(mWifiManager).getFactoryMacAddresses();