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

Commit 92851f84 authored by Paul Duffin's avatar Paul Duffin Committed by Gerrit Code Review
Browse files

Merge "Refactor code incompatible with Mockito 2.7.13"

parents 995e90e5 f9339819
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));