DefaultErrorBundle implements ErrorBundle { @Override public Exception getException() { return exception; } DefaultErrorBundle(Exception exception); @Override Exception getException(); @Override String getErrorMessage();  }
@Test public void shouldReturnNullExceptionGivenANullException() throws Exception { DefaultErrorBundle defaultErrorBundle = new DefaultErrorBundle(null); Exception exception = defaultErrorBundle.getException(); assertThat(exception).isNull(); }
@Test public void shouldReturnTheRightException() throws Exception { RuntimeException runtimeException = new RuntimeException(); DefaultErrorBundle defaultErrorBundle = new DefaultErrorBundle(runtimeException); Exception exception = defaultErrorBundle.getException(); assertThat(exception).isNotNull(); assertThat(exception).isInstanceOf(RuntimeException.class); }