@Test public void testThatDefaultExceptionHandlerIsAlwaysCalled() { final AmplifyExceptionHandler amplifyExceptionHandler = new AmplifyExceptionHandler(mockAppLevelEventRulesManager, mockDefaultExceptionHandler); final Throwable expectedThrowable = new Throwable("any string"); amplifyExceptionHandler.uncaughtException(new Thread(), expectedThrowable); verify(mockDefaultExceptionHandler, times(1)) .uncaughtException(any(Thread.class), throwableCaptor.capture()); final Throwable actualThrowable = throwableCaptor.getValue(); assertEquals( "The original throwable should have been passed to the default exception handler", expectedThrowable, actualThrowable); }
@Override public void uncaughtException(final Thread thread, final Throwable throwable) { appLevelEventRulesManager.notifyOfCrash(); if (defaultExceptionHandler != null) { defaultExceptionHandler.uncaughtException(thread, throwable); } }
AmplifyExceptionHandler implements UncaughtExceptionHandler { @Override public void uncaughtException(final Thread thread, final Throwable throwable) { appLevelEventRulesManager.notifyOfCrash(); if (defaultExceptionHandler != null) { defaultExceptionHandler.uncaughtException(thread, throwable); } } }
AmplifyExceptionHandler implements UncaughtExceptionHandler { @Override public void uncaughtException(final Thread thread, final Throwable throwable) { appLevelEventRulesManager.notifyOfCrash(); if (defaultExceptionHandler != null) { defaultExceptionHandler.uncaughtException(thread, throwable); } } AmplifyExceptionHandler(
            @NonNull final IAppLevelEventRulesManager appLevelEventRulesManager,
            @Nullable final UncaughtExceptionHandler defaultExceptionHandler); }
AmplifyExceptionHandler implements UncaughtExceptionHandler { @Override public void uncaughtException(final Thread thread, final Throwable throwable) { appLevelEventRulesManager.notifyOfCrash(); if (defaultExceptionHandler != null) { defaultExceptionHandler.uncaughtException(thread, throwable); } } AmplifyExceptionHandler(
            @NonNull final IAppLevelEventRulesManager appLevelEventRulesManager,
            @Nullable final UncaughtExceptionHandler defaultExceptionHandler); @Override void uncaughtException(final Thread thread, final Throwable throwable); }
AmplifyExceptionHandler implements UncaughtExceptionHandler { @Override public void uncaughtException(final Thread thread, final Throwable throwable) { appLevelEventRulesManager.notifyOfCrash(); if (defaultExceptionHandler != null) { defaultExceptionHandler.uncaughtException(thread, throwable); } } AmplifyExceptionHandler(
            @NonNull final IAppLevelEventRulesManager appLevelEventRulesManager,
            @Nullable final UncaughtExceptionHandler defaultExceptionHandler); @Override void uncaughtException(final Thread thread, final Throwable throwable);  }