Search in sources :

Example 11 with RecordBar

use of com.linkedin.pegasus.generator.test.RecordBar in project rest.li by linkedin.

the class TestRestUtils method testMapTrim.

@Test
public void testMapTrim() throws CloneNotSupportedException {
    TyperefTest test = new TyperefTest();
    RecordBarMap map = new RecordBarMap();
    RecordBar recordBar = new RecordBar();
    recordBar.setLocation("foo");
    map.put("map", recordBar);
    test.setBarRefMap(map);
    TyperefTest expected = test.copy();
    test.getBarRefMap().get("map").data().put("troublemaker", "data filth");
    Assert.assertEquals(recordBar.data().size(), 2);
    Assert.assertEquals(test.getBarRefMap().get("map").data().size(), 2);
    RestUtils.trimRecordTemplate(test, false);
    Assert.assertEquals(expected, test);
}
Also used : TyperefTest(com.linkedin.pegasus.generator.test.TyperefTest) RecordBar(com.linkedin.pegasus.generator.test.RecordBar) RecordBarMap(com.linkedin.pegasus.generator.test.RecordBarMap) UnionTest(com.linkedin.pegasus.generator.test.UnionTest) Test(org.testng.annotations.Test) TyperefTest(com.linkedin.pegasus.generator.test.TyperefTest)

Aggregations

RecordBar (com.linkedin.pegasus.generator.test.RecordBar)11 Test (org.testng.annotations.Test)11 TyperefTest (com.linkedin.pegasus.generator.test.TyperefTest)8 UnionTest (com.linkedin.pegasus.generator.test.UnionTest)8 DataMap (com.linkedin.data.DataMap)4 ArrayTest (com.linkedin.pegasus.generator.test.ArrayTest)3 RecordBarMap (com.linkedin.pegasus.generator.test.RecordBarMap)3 ByteString (com.linkedin.data.ByteString)2 PathSpec (com.linkedin.data.schema.PathSpec)2 MaskTree (com.linkedin.data.transform.filter.request.MaskTree)2 RecordBarArray (com.linkedin.pegasus.generator.test.RecordBarArray)2 DataList (com.linkedin.data.DataList)1 BooleanArray (com.linkedin.data.template.BooleanArray)1 BooleanMap (com.linkedin.data.template.BooleanMap)1 BytesArray (com.linkedin.data.template.BytesArray)1 BytesMap (com.linkedin.data.template.BytesMap)1 DoubleArray (com.linkedin.data.template.DoubleArray)1 DoubleMap (com.linkedin.data.template.DoubleMap)1 FloatArray (com.linkedin.data.template.FloatArray)1 FloatMap (com.linkedin.data.template.FloatMap)1