Move away from deprecated FakeFeatureFactory.setupForTest()

Test: rerun
Change-Id: I896ba414315ddb1664c0499264f4992f0554ef98
This commit is contained in:
Fan Zhang
2017-12-04 15:24:45 -08:00
parent caf5358e40
commit dff6dd687e
101 changed files with 330 additions and 538 deletions

View File

@@ -17,7 +17,6 @@
package com.android.settings.applications;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -60,8 +59,6 @@ import org.robolectric.util.ReflectionHelpers;
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O,
shadows = ShadowEntityHeaderController.class)
public class AppInfoWithHeaderTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private Context mContext;
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private EntityHeaderController mHeaderController;
@@ -71,9 +68,7 @@ public class AppInfoWithHeaderTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
FakeFeatureFactory.setupForTest(mContext);
mFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
mFactory = FakeFeatureFactory.setupForTest();
when(mFactory.metricsFeatureProvider.getMetricsCategory(any(Object.class)))
.thenReturn(MetricsProto.MetricsEvent.SETTINGS_APP_NOTIF_CATEGORY);
mAppInfoWithHeader = new TestFragment();