Search in sources :

Example 1 with CustomIntMap

use of com.linkedin.pegasus.generator.test.idl.customtypes.CustomIntMap in project rest.li by linkedin.

the class MapGeneratorTest method testWithCustomTypesMap.

@Test
public void testWithCustomTypesMap() throws Throwable {
    String json = load("WithCustomTypesMap.json");
    WithCustomTypesMap original = new WithCustomTypesMap();
    CustomIntMap ints = new CustomIntMap();
    ints.put("a", new CustomInt(1));
    ints.put("b", new CustomInt(2));
    ints.put("c", new CustomInt(3));
    original.setInts(ints);
    assertJson(original, json);
    WithCustomTypesMap roundTripped = new WithCustomTypesMap(roundTrip(original.data()));
    assertJson(roundTripped, json);
}
Also used : WithCustomTypesMap(com.linkedin.pegasus.generator.test.idl.maps.WithCustomTypesMap) CustomIntMap(com.linkedin.pegasus.generator.test.idl.customtypes.CustomIntMap) CustomInt(com.linkedin.pegasus.generator.test.pdl.fixtures.CustomInt) Test(org.testng.annotations.Test)

Aggregations

CustomIntMap (com.linkedin.pegasus.generator.test.idl.customtypes.CustomIntMap)1 WithCustomTypesMap (com.linkedin.pegasus.generator.test.idl.maps.WithCustomTypesMap)1 CustomInt (com.linkedin.pegasus.generator.test.pdl.fixtures.CustomInt)1 Test (org.testng.annotations.Test)1