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

Commit f9339819 authored by Paul Duffin's avatar Paul Duffin
Browse files

Refactor code incompatible with Mockito 2.7.13

Bug: 32912773
Test: make checkbuild
Change-Id: Ie5ac742d4376e96286cc527a2331e91a17c85fd8
parent 07927798
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.ArgumentMatcher;
import org.mockito.compat.ArgumentMatcher;

import java.util.ArrayList;
import java.util.Arrays;
@@ -161,7 +161,7 @@ public class CarrierSignalAgentTest extends TelephonyTest {
                .when(mPackageManager).queryBroadcastReceivers(
                argThat(new ArgumentMatcher<Intent>() {
                    @Override
                    public boolean matches(Object o) {
                    public boolean matchesObject(Object o) {
                        return o instanceof Intent && ((Intent) o).getAction()
                                .equals(ACTION_CARRIER_SIGNAL_PCO_VALUE); }}), anyInt());

+7 −7
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ public class DcTrackerTest extends TelephonyTest {
        allowed = isDataAllowed(failureReason);
        assertTrue(failureReason.getDataAllowFailReason(), allowed);

        ArgumentCaptor<DataProfile> dpCaptor = new ArgumentCaptor<>();
        ArgumentCaptor<DataProfile> dpCaptor = ArgumentCaptor.forClass(DataProfile.class);
        // Verify if RIL command was sent properly.
        verify(mSimulatedCommandsVerifier, times(1)).setupDataCall(
                eq(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS), dpCaptor.capture(),
@@ -535,7 +535,7 @@ public class DcTrackerTest extends TelephonyTest {
        allowed = isDataAllowed(failureReason);
        assertTrue(failureReason.getDataAllowFailReason(), allowed);

        ArgumentCaptor<DataProfile> dpCaptor = new ArgumentCaptor<>();
        ArgumentCaptor<DataProfile> dpCaptor = ArgumentCaptor.forClass(DataProfile.class);
        // Verify if RIL command was sent properly.
        verify(mSimulatedCommandsVerifier, times(1)).setupDataCall(
                eq(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS), dpCaptor.capture(),
@@ -561,7 +561,7 @@ public class DcTrackerTest extends TelephonyTest {
        mContext.sendBroadcast(intent);
        waitForMs(200);

        dpCaptor = new ArgumentCaptor<>();
        dpCaptor = ArgumentCaptor.forClass(DataProfile.class);
        // Verify if RIL command was sent properly.
        verify(mSimulatedCommandsVerifier, times(2)).setupDataCall(
                eq(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS), dpCaptor.capture(),
@@ -595,7 +595,7 @@ public class DcTrackerTest extends TelephonyTest {
        mDct.setDataEnabled(true);

        waitForMs(200);
        ArgumentCaptor<DataProfile> dpCaptor = new ArgumentCaptor<>();
        ArgumentCaptor<DataProfile> dpCaptor = ArgumentCaptor.forClass(DataProfile.class);
        verify(mSimulatedCommandsVerifier, times(2)).setupDataCall(
                eq(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS), dpCaptor.capture(),
                eq(false), eq(false), any(Message.class));
@@ -646,7 +646,7 @@ public class DcTrackerTest extends TelephonyTest {
        mDct.setDataEnabled(true);

        waitForMs(300);
        ArgumentCaptor<DataProfile> dpCaptor = new ArgumentCaptor<>();
        ArgumentCaptor<DataProfile> dpCaptor = ArgumentCaptor.forClass(DataProfile.class);
        verify(mSimulatedCommandsVerifier, times(2)).setupDataCall(
                eq(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS), dpCaptor.capture(),
                eq(false), eq(false), any(Message.class));
@@ -706,7 +706,7 @@ public class DcTrackerTest extends TelephonyTest {
        mDct.setDataEnabled(true);

        waitForMs(200);
        ArgumentCaptor<DataProfile> dpCaptor = new ArgumentCaptor<>();
        ArgumentCaptor<DataProfile> dpCaptor = ArgumentCaptor.forClass(DataProfile.class);
        verify(mSimulatedCommandsVerifier, times(1)).setupDataCall(
                eq(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS), dpCaptor.capture(),
                eq(false), eq(false), any(Message.class));
@@ -809,7 +809,7 @@ public class DcTrackerTest extends TelephonyTest {
        mDct.sendMessage(mDct.obtainMessage(DctConstants.EVENT_DATA_CONNECTION_ATTACHED, null));
        waitForMs(200);

        ArgumentCaptor<DataProfile> dpCaptor = new ArgumentCaptor<>();
        ArgumentCaptor<DataProfile> dpCaptor = ArgumentCaptor.forClass(DataProfile.class);
        verify(mSimulatedCommandsVerifier, times(2)).setupDataCall(
                eq(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS), dpCaptor.capture(),
                eq(false), eq(false), any(Message.class));