@Test
public void serializerWritesRawValue() throws IOException {

    // given
    JsonSerializer<Message> serializer = new JacksonJsonMessageSerializer();
    Message message = mock(Message.class);
    String expectedValue = UUID.randomUUID().toString();
    when(message.getFormattedMessage()).thenReturn(expectedValue);
    JsonGenerator jsonGenerator = mock(JsonGenerator.class);
    // when
    serializer.serialize(message, jsonGenerator, mock(SerializerProvider.class));
    // then
    verify(jsonGenerator).writeRaw(eq(expectedValue));
}