Fix the testcase failed
Add mock for SubscriptionManager.createForAllUserProfiles Bug: 323652989 Test: atest MobileNetworkPreferenceControllerTest Change-Id: I96574a79eba581db95d387f0d9c9fde2e004c41c
This commit is contained in:
@@ -78,6 +78,7 @@ public class MobileNetworkPreferenceControllerTest {
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager);
|
||||
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
|
||||
when(mSubscriptionManager.createForAllUserProfiles()).thenReturn(mSubscriptionManager);
|
||||
when(mContext.getSystemService(UserManager.class)).thenReturn(mUserManager);
|
||||
if (Looper.myLooper() == null) {
|
||||
Looper.prepare();
|
||||
|
Reference in New Issue
Block a user