Merge "CallFeaturesSettingTest: Solves failing test case" am: 6f51c6caa1 am: ddea30cf66 am: d5e75d173c
am: b4c261766d
Change-Id: If812b57e5551ba9e7d62c586ccc273771c6939a5
diff --git a/tests/src/com/android/phone/CallFeaturesSettingTest.java b/tests/src/com/android/phone/CallFeaturesSettingTest.java
index 78d68e3..15d48ba 100644
--- a/tests/src/com/android/phone/CallFeaturesSettingTest.java
+++ b/tests/src/com/android/phone/CallFeaturesSettingTest.java
@@ -21,8 +21,12 @@
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.when;
+import android.content.Context;
+
+import androidx.test.InstrumentationRegistry;
import androidx.test.filters.FlakyTest;
import androidx.test.rule.ActivityTestRule;
@@ -52,6 +56,8 @@
public void setUp() {
MockitoAnnotations.initMocks(this);
mActivity = mRule.getActivity();
+ Context targetContext = InstrumentationRegistry.getTargetContext();
+ doReturn(targetContext).when(mMockPhone).getContext();
}
@FlakyTest