use of com.linkedin.pegasus.generator.test.idl.records.WithOptionalComplexTypeDefaults in project rest.li by linkedin.
the class RecordGeneratorTest method testWithOptionalComplexTypesDefaults.
@Test
public void testWithOptionalComplexTypesDefaults() {
WithOptionalComplexTypeDefaults withDefaults = new WithOptionalComplexTypeDefaults();
Simple simple = new Simple();
simple.setMessage("defaults!");
assertEquals(withDefaults.getRecord(), simple);
assertEquals(withDefaults.getEnum(), Fruits.APPLE);
assertEquals(withDefaults.getUnion(), WithComplexTypeDefaults.Union.create(1));
IntegerArray intArray = new IntegerArray();
intArray.add(1);
assertEquals(withDefaults.getArray(), intArray);
IntegerMap intMap = new IntegerMap();
intMap.put("a", 1);
assertEquals(withDefaults.getMap(), intMap);
assertEquals(withDefaults.getCustom(), new CustomInt(1));
}
Aggregations