Search in sources :

Example 6 with Simple

use of com.linkedin.pegasus.generator.test.idl.records.Simple 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));
}
Also used : IntegerMap(com.linkedin.data.template.IntegerMap) WithComplexTypeDefaults(com.linkedin.pegasus.generator.test.idl.records.WithComplexTypeDefaults) CustomInt(com.linkedin.pegasus.generator.test.pdl.fixtures.CustomInt) Simple(com.linkedin.pegasus.generator.test.idl.records.Simple) IntegerArray(com.linkedin.data.template.IntegerArray) Test(org.testng.annotations.Test)

Aggregations

Simple (com.linkedin.pegasus.generator.test.idl.records.Simple)6 Test (org.testng.annotations.Test)6 SimpleMap (com.linkedin.pegasus.generator.test.idl.records.SimpleMap)4 CustomInt (com.linkedin.pegasus.generator.test.pdl.fixtures.CustomInt)4 IntegerArray (com.linkedin.data.template.IntegerArray)3 IntegerMap (com.linkedin.data.template.IntegerMap)3 SimpleArray (com.linkedin.pegasus.generator.test.idl.records.SimpleArray)3 Fixed8 (com.linkedin.pegasus.generator.test.idl.fixed.Fixed8)2 Empty (com.linkedin.pegasus.generator.test.idl.records.Empty)2 WithCustomTypesArray (com.linkedin.pegasus.generator.test.idl.arrays.WithCustomTypesArray)1 WithCustomTypesArrayUnionArray (com.linkedin.pegasus.generator.test.idl.arrays.WithCustomTypesArrayUnionArray)1 CustomIntArray (com.linkedin.pegasus.generator.test.idl.customtypes.CustomIntArray)1 FruitsMap (com.linkedin.pegasus.generator.test.idl.enums.FruitsMap)1 Fixed8Array (com.linkedin.pegasus.generator.test.idl.fixed.Fixed8Array)1 Fixed8Map (com.linkedin.pegasus.generator.test.idl.fixed.Fixed8Map)1 WithComplexTypesMap (com.linkedin.pegasus.generator.test.idl.maps.WithComplexTypesMap)1 WithComplexTypesMapUnionMap (com.linkedin.pegasus.generator.test.idl.maps.WithComplexTypesMapUnionMap)1 EmptyMap (com.linkedin.pegasus.generator.test.idl.records.EmptyMap)1 SimpleArrayArray (com.linkedin.pegasus.generator.test.idl.records.SimpleArrayArray)1 SimpleArrayMap (com.linkedin.pegasus.generator.test.idl.records.SimpleArrayMap)1