@Test
public void shouldProperlySerializeMessage() throws Exception {

  ErrorMessage errorMessage = new ErrorMessage.Builder().with(404).and("Not found!").build();
  String fakeSerializedJson = "{status:fail, message:not found!}";
  when(jsonSerializer.toJson(errorMessage)).thenReturn(fakeSerializedJson);
  String message = messageJsonMapper.transformMessage(errorMessage);
  assertThat(message).isNotNull();
  assertThat(message.length()).isEqualTo(fakeSerializedJson.length());
}