use of org.opensearch.client.opensearch.core.GetSourceResponse in project opensearch-java by opensearch-project.
the class SerializationTest method testGenericValueBody.
@Test
public void testGenericValueBody() {
GetSourceResponse<String> r = GetSourceResponse.of(_0 -> _0.valueBody("The value"));
String json = toJson(r);
assertEquals("\"The value\"", json);
JsonpDeserializer<GetSourceResponse<String>> deserializer = GetSourceResponse.createGetSourceResponseDeserializer(JsonpDeserializer.stringDeserializer());
r = deserializer.deserialize(mapper.jsonProvider().createParser(new StringReader(json)), mapper);
assertEquals("The value", r.valueBody());
}
Aggregations