use of org.camunda.bpm.model.xml.testmodel.instance.Animal in project camunda-xml-model by camunda.
the class TestModelInstanceTest method testClone.
@Test
public void testClone() throws Exception {
ModelInstance modelInstance = new TestModelParser().getEmptyModel();
Animals animals = modelInstance.newInstance(Animals.class);
modelInstance.setDocumentElement(animals);
Animal animal = modelInstance.newInstance(Bird.class);
animal.setId("TestId");
animals.addChildElement(animal);
ModelInstance cloneInstance = modelInstance.clone();
getFirstAnimal(cloneInstance).setId("TestId2");
assertThat(getFirstAnimal(modelInstance).getId(), is(equalTo("TestId")));
assertThat(getFirstAnimal(cloneInstance).getId(), is(equalTo("TestId2")));
}
Aggregations