use of com.linkedin.restli.client.util.test.FooRecordTemplate in project rest.li by linkedin.
the class TestPatchTreeRecorder method testSetRecordTemplate.
@Test
public void testSetRecordTemplate() {
PatchTreeRecorder<PatchTreeTestModel> pc = makeOne();
pc.getRecordingProxy().setFooRecordTemplate(new FooRecordTemplate().setBar(20));
PatchTreeTestModel expectModel = new PatchTreeTestModel().setFooRecordTemplate(new FooRecordTemplate().setBar(20));
Assert.assertEquals(pc.generatePatchTree().getDataMap(), diffEmpty(expectModel));
}
use of com.linkedin.restli.client.util.test.FooRecordTemplate in project rest.li by linkedin.
the class TestPatchTreeRecorder method testPatchGeneratesDeepCopiesOfInternalState.
@Test
public void testPatchGeneratesDeepCopiesOfInternalState() {
PatchTreeRecorder<PatchTreeTestModel> pc = makeOne();
PatchTreeTestModel restCommonTestModel = pc.getRecordingProxy();
restCommonTestModel.setFooRecordTemplate(new FooRecordTemplate().setBar(10l));
PatchTree pt1 = pc.generatePatchTree();
restCommonTestModel.setFooRecordTemplate(new FooRecordTemplate().setBar(20l));
PatchTree pt2 = pc.generatePatchTree();
Assert.assertNotEquals(pt1.getDataMap(), pt2.getDataMap());
Assert.assertEquals(pt1.getDataMap(), diffEmpty(new PatchTreeTestModel().setFooRecordTemplate(new FooRecordTemplate().setBar(10l))));
Assert.assertEquals(pt2.getDataMap(), diffEmpty(new PatchTreeTestModel().setFooRecordTemplate(new FooRecordTemplate().setBar(20l))));
}
Aggregations