Search in sources :

Example 1 with WithPrimitiveCustomTypesUnion

use of com.linkedin.pegasus.generator.test.idl.unions.WithPrimitiveCustomTypesUnion in project rest.li by linkedin.

the class UnionGeneratorTest method testWithPrimitiveCustomTypesUnion.

@Test
public void testWithPrimitiveCustomTypesUnion() throws Throwable {
    String json = load("WithPrimitiveCustomTypesUnion_int.json");
    WithPrimitiveCustomTypesUnion original = new WithPrimitiveCustomTypesUnion();
    original.setUnion(WithPrimitiveCustomTypesUnion.Union.create(new CustomInt(1)));
    assertJson(original, json);
    WithPrimitiveCustomTypesUnion roundTripped = new WithPrimitiveCustomTypesUnion(roundTrip(original.data()));
    assertJson(roundTripped, json);
}
Also used : WithPrimitiveCustomTypesUnion(com.linkedin.pegasus.generator.test.idl.unions.WithPrimitiveCustomTypesUnion) CustomInt(com.linkedin.pegasus.generator.test.pdl.fixtures.CustomInt) Test(org.testng.annotations.Test)

Aggregations

WithPrimitiveCustomTypesUnion (com.linkedin.pegasus.generator.test.idl.unions.WithPrimitiveCustomTypesUnion)1 CustomInt (com.linkedin.pegasus.generator.test.pdl.fixtures.CustomInt)1 Test (org.testng.annotations.Test)1