use of com.linkedin.pegasus.generator.test.idl.records.WithComplexTypeDefaults in project rest.li by linkedin.
the class RecordGeneratorTest method testWithComplexTypesDefaults.
@Test
public void testWithComplexTypesDefaults() {
WithComplexTypeDefaults withDefaults = new WithComplexTypeDefaults();
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