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

Commit 53745c96 authored by Brad Ebinger's avatar Brad Ebinger Committed by Android (Google) Code Review
Browse files

Merge "Fix unit tests to not depend on ImsConfig" into pi-dev

parents fd13d127 09540649
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@ public class ImsManagerTest extends TelephonyTest {
    Hashtable<Integer, Integer> mProvisionedIntVals = new Hashtable<>();
    Hashtable<Integer, String> mProvisionedStringVals = new Hashtable<>();
    ImsConfigImplBase.ImsConfigStub mImsConfigStub;
    ImsConfig mImsConfig;
    @Mock MmTelFeatureConnection mMmTelFeatureConnection;

    private final int[] mSubId = {0};
@@ -272,7 +271,7 @@ public class ImsManagerTest extends TelephonyTest {
                eq(ImsConfig.WfcModeFeatureValueConstants.CELLULAR_PREFERRED));
    }

    private ImsManager initializeProvisionedValues() {
    private ImsManager initializeProvisionedValues() throws Exception {
        when(mImsConfigImplBaseMock.getConfigInt(anyInt()))
                .thenAnswer(invocation ->  {
                    return getProvisionedInt((Integer) (invocation.getArguments()[0]));
@@ -288,15 +287,11 @@ public class ImsManagerTest extends TelephonyTest {

        // Configure ImsConfigStub
        mImsConfigStub = new ImsConfigImplBase.ImsConfigStub(mImsConfigImplBaseMock);
        doReturn(mImsConfigStub).when(mImsConfigImplBaseMock).getIImsConfig();

        // Configure ImsConfig
        mImsConfig = new ImsConfig(mImsConfigStub, mContext);
        doReturn(mImsConfigStub).when(mMmTelFeatureConnection).getConfigInterface();

        // Configure ImsManager
        ImsManager imsManager = ImsManager.getInstance(mContext, mPhoneId);
        try {
            replaceInstance(ImsManager.class, "mConfig", imsManager, mImsConfig);
            replaceInstance(ImsManager.class, "mMmTelFeatureConnection", imsManager,
                    mMmTelFeatureConnection);
        } catch (Exception ex) {