@Test
public void testObjectToJson() throws Exception {

    AvroToJson avroToJson = new AvroToJson();
    Thing thing = new Thing();
    ObjectMapper objectMapper = new ObjectMapper();
    byte[] jsonBytes = avroToJson.objectToJson(thing);
    Map<String,String> obj = objectMapper.readValue(jsonBytes, Map.class);
    assertEquals("hi", obj.get("foo"));
    assertEquals("hello", obj.get("bar"));
    String jsonStr = new String(jsonBytes, StandardCharsets.UTF_8);
    assertTrue(jsonStr.contains("\"bar\":\"hello\""));
}