use of com.google.firebase.crashlytics.internal.settings.TestSettings in project firebase-android-sdk by firebase.
the class CrashlyticsControllerTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
testContext = getContext();
FirebaseInstallationsApi installationsApiMock = mock(FirebaseInstallationsApi.class);
when(installationsApiMock.getId()).thenReturn(Tasks.forResult("instanceId"));
idManager = new IdManager(testContext, testContext.getPackageName(), installationsApiMock, DataCollectionArbiterTest.MOCK_ARBITER_ENABLED);
testFileStore = new FileStore(testContext);
Settings testSettings = new TestSettings(3);
mockSessionReportingCoordinator = mock(SessionReportingCoordinator.class);
mockDataCollectionArbiter = mock(DataCollectionArbiter.class);
when(mockDataCollectionArbiter.isAutomaticDataCollectionEnabled()).thenReturn(true);
testSettingsProvider = mock(SettingsProvider.class);
when(testSettingsProvider.getSettingsSync()).thenReturn(testSettings);
when(testSettingsProvider.getSettingsAsync()).thenReturn(Tasks.forResult(testSettings));
}
use of com.google.firebase.crashlytics.internal.settings.TestSettings in project firebase-android-sdk by firebase.
the class CrashlyticsCoreInitializationTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
mockAppContext = newMockContext();
mockResources = mock(Resources.class);
testFirebaseOptions = new FirebaseOptions.Builder().setApplicationId(GOOGLE_APP_ID).build();
fileStore = new FileStore(getContext());
mockSettingsController = mock(SettingsController.class);
Settings settings = new TestSettings();
when(mockSettingsController.getSettingsSync()).thenReturn(settings);
when(mockSettingsController.getSettingsAsync()).thenReturn(Tasks.forResult(settings));
}
use of com.google.firebase.crashlytics.internal.settings.TestSettings in project firebase-android-sdk by firebase.
the class CrashlyticsCoreTest method startCoreAsync.
// Starts the given CrashlyticsCore.
private Task<CrashlyticsCore> startCoreAsync(CrashlyticsCore crashlyticsCore) {
// Swallow exceptions so tests don't crash.
Thread.setDefaultUncaughtExceptionHandler(NOOP_HANDLER);
SettingsController mockSettingsController = mock(SettingsController.class);
final Settings settings = new TestSettings(3);
when(mockSettingsController.getSettingsSync()).thenReturn(settings);
when(mockSettingsController.getSettingsAsync()).thenReturn(Tasks.forResult(settings));
AppData appData = new AppData(GOOGLE_APP_ID, "buildId", "installerPackageName", "packageName", "versionCode", "versionName", mock(DevelopmentPlatformProvider.class));
crashlyticsCore.onPreExecute(appData, mockSettingsController);
return crashlyticsCore.doBackgroundInitializationAsync(mockSettingsController).onSuccessTask(new SuccessContinuation<Void, CrashlyticsCore>() {
@NonNull
@Override
public Task<CrashlyticsCore> then(@Nullable Void aVoid) throws Exception {
return Tasks.forResult(crashlyticsCore);
}
});
}
Aggregations