@Test
public void serializerUsesFormatedMesage() throws IOException {

    // given
    JsonSerializer<Message> serializer = new JacksonJsonMessageSerializer();
    Message message = mock(Message.class);
    // when
    serializer.serialize(message, mock(JsonGenerator.class), mock(SerializerProvider.class));
    // then
    verify(message).getFormattedMessage();
}