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

Commit 2a4688b9 authored by Brad Ebinger's avatar Brad Ebinger Committed by Gerrit Code Review
Browse files

Merge "Fix unit tests to not depend on ImsConfig"

parents 842adf9a 55a91da9
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -69,7 +69,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};
@@ -368,7 +367,7 @@ public class ImsManagerTest extends TelephonyTest {
                eq(WFC_IMS_MODE_DEFAULT_VAL));
    }

    private ImsManager initializeProvisionedValues() {
    private ImsManager initializeProvisionedValues() throws Exception {
        when(mImsConfigImplBaseMock.getConfigInt(anyInt()))
                .thenAnswer(invocation ->  {
                    return getProvisionedInt((Integer) (invocation.getArguments()[0]));
@@ -384,15 +383,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) {