MarshmallowNetworkObservingStrategy implements NetworkObservingStrategy { @Override public void onError(final String message, final Exception exception) { Log.e(LOG_TAG, message, exception); } @SuppressWarnings("NullAway") // networkCallback cannot be initialized here  MarshmallowNetworkObservingStrategy(); @Override Observable<Connectivity> observeNetworkConnectivity(final Context context); @Override void onError(final String message, final Exception exception);  }
@Test public void shouldCallOnError() { final String message = "error message"; final Exception exception = new Exception(); strategy.onError(message, exception); verify(strategy, times(1)).onError(message, exception); }