Search in sources :

Example 1 with AnalyticsEventLogger

use of com.google.firebase.crashlytics.internal.analytics.AnalyticsEventLogger in project firebase-android-sdk by firebase.

the class CrashlyticsControllerTest method testFatalEvent_sendsAppExceptionEvent.

public void testFatalEvent_sendsAppExceptionEvent() {
    final String sessionId = "sessionId";
    final LogFileManager logFileManager = new LogFileManager(testFileStore);
    final AnalyticsEventLogger mockFirebaseAnalyticsLogger = mock(AnalyticsEventLogger.class);
    final CrashlyticsController controller = builder().setAnalyticsEventLogger(mockFirebaseAnalyticsLogger).setLogFileManager(logFileManager).build();
    when(mockSessionReportingCoordinator.listSortedOpenSessionIds()).thenReturn(new TreeSet<>(Collections.singleton(sessionId)));
    controller.openSession(SESSION_ID);
    controller.handleUncaughtException(testSettingsProvider, Thread.currentThread(), new RuntimeException("Fatal"));
    controller.finalizeSessions(testSettingsProvider);
    assertFirebaseAnalyticsCrashEvent(mockFirebaseAnalyticsLogger);
}
Also used : Mockito.anyString(org.mockito.Mockito.anyString) LogFileManager(com.google.firebase.crashlytics.internal.metadata.LogFileManager) AnalyticsEventLogger(com.google.firebase.crashlytics.internal.analytics.AnalyticsEventLogger)

Aggregations

AnalyticsEventLogger (com.google.firebase.crashlytics.internal.analytics.AnalyticsEventLogger)1 LogFileManager (com.google.firebase.crashlytics.internal.metadata.LogFileManager)1 Mockito.anyString (org.mockito.Mockito.anyString)1