use of org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.SerializerProvider in project dhis2-core by dhis2.
the class CustomLastUpdatedUserSerializerTest method serializeJson.
@Test
void serializeJson() throws Exception {
Writer jsonWriter = new StringWriter();
JsonGenerator jsonGenerator = new JsonFactory().createGenerator(jsonWriter);
SerializerProvider serializerProvider = new ObjectMapper().getSerializerProvider();
new CustomLastUpdatedUserSerializer().serialize(user, jsonGenerator, serializerProvider);
jsonGenerator.flush();
assertEquals("{\"id\":\"jshfdkd323\",\"name\":\"Peter Brown\"}", jsonWriter.toString());
}
Aggregations