ErrorMessage { public String getMessage() { return message; } ErrorMessage(Exception exception);  ErrorMessage(String type, String message); String getType(); String getMessage(); void addInfos(Map<String, Object> infos); void addInfo(String key, Object value); Map<String, Object> getInfos();  }
@Test public void should_set_exception_message_as_message() throws Exception { Exception exception = new Exception("an error message"); ErrorMessage errorMessage = new ErrorMessage(exception); assertThat(errorMessage.getMessage()).isEqualTo("an error message"); }