use of com.linkedin.pegasus.generator.test.idl.unions.WithPrimitiveCustomTypesUnion in project rest.li by linkedin.
the class UnionGeneratorTest method testWithPrimitiveCustomTypesUnion.
@Test
public void testWithPrimitiveCustomTypesUnion() throws Throwable {
String json = load("WithPrimitiveCustomTypesUnion_int.json");
WithPrimitiveCustomTypesUnion original = new WithPrimitiveCustomTypesUnion();
original.setUnion(WithPrimitiveCustomTypesUnion.Union.create(new CustomInt(1)));
assertJson(original, json);
WithPrimitiveCustomTypesUnion roundTripped = new WithPrimitiveCustomTypesUnion(roundTrip(original.data()));
assertJson(roundTripped, json);
}
Aggregations