@Test
public void shouldSerializeMessageToJsonString() throws IOException {

  // Given:
  final Schema msgSchema = SchemaBuilder.struct()
      .field("field1", Schema.STRING_SCHEMA)
      .field("field2", Schema.INT32_SCHEMA)
      .build();
  final Struct msgStruct = new Struct(msgSchema);
  msgStruct.put("field1", "foobar");
  msgStruct.put("field2", 123);
  final SchemaAndValue schemaAndValue = new SchemaAndValue(msgSchema, msgStruct);
  // When:
  logger.info(schemaAndValue);
  // Then:
  verify(innerLogger).info(any(), captor.capture());
  final String asString = captor.getValue().toString();
  final Object deserialized = new ObjectMapper().readValue(asString, Object.class);
  assertThat(deserialized, instanceOf(Map.class));
  assertThat(
      deserialized,
      equalTo(
          ImmutableMap.of(
              "field1", "foobar",
              "field2", 123)));
}