use of com.linkedin.pegasus.generator.test.idl.records.WithComplexTyperefs in project rest.li by linkedin.
the class TyperefGeneratorTest method testWithComplexTyperefs.
@Test
public void testWithComplexTyperefs() throws Throwable {
WithComplexTyperefs original = new WithComplexTyperefs();
original.setEnum(Fruits.APPLE);
original.setRecord(new Empty());
EmptyMap emptyMap = new EmptyMap();
emptyMap.put("a", new Empty());
original.setMap(emptyMap);
EmptyArray emptyArray = new EmptyArray();
emptyArray.add(new Empty());
original.setArray(emptyArray);
original.setUnion(UnionTyperef.create(1));
WithComplexTyperefs roundTripped = new WithComplexTyperefs(roundTrip(original.data()));
assertEquals(original.data(), roundTripped.data());
}
Aggregations