use of com.instagram.common.json.annotation.processor.nobodies.NoBodyUUT in project ig-json-parser by Instagram.
the class NobodiesTest method serializeIsNoOp.
@Test
public void serializeIsNoOp() throws IOException {
StringWriter stringWriter = new StringWriter();
JsonGenerator jsonGenerator = new JsonFactory().createGenerator(stringWriter);
NoBodyUUT obj = new NoBodyUUT();
obj.mValue = "some-value";
NoBodyUUT__JsonHelper.serializeToJson(jsonGenerator, obj, true);
jsonGenerator.close();
String serialized = stringWriter.toString();
assertEquals("{}", serialized);
}
use of com.instagram.common.json.annotation.processor.nobodies.NoBodyUUT in project ig-json-parser by Instagram.
the class NobodiesTest method deserializeIsNoOp.
@Test
public void deserializeIsNoOp() throws IOException {
JsonParser jp = new JsonFactory().createParser("{\"value\":\"some-value\"}");
jp.nextToken();
NoBodyUUT obj = NoBodyUUT__JsonHelper.parseFromJson(jp);
assertNull(obj.mValue);
}
Aggregations