@BeforeClass public static void beforeClass() { // demonstrate our ability to set advanced configuration on a mapper ObjectMapper mapper = new ObjectMapper(); // in this case, we're saying wrap our serialization with the name of the pojo class mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.WRAPPER_OBJECT); // register a JacksonDatabindHandleFactory ready to marshall any City object to/from json // this enables the writeAs method below DatabaseClientFactory.getHandleRegistry().register( JacksonDatabindHandle.newFactory(mapper, City.class) ); // we cannot use the singleton DatabaseClient here because this test requires // a DatabaseClient created after calling getHandleRegistry().register() with City.class client = Common.newClient(); }