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);
}
Aggregations