use of org.openforis.idm.testfixture.TestFixture in project collect by openforis.
the class RecordTest method testRootEntityCanBeReplaced.
@Test
public void testRootEntityCanBeReplaced() {
TestFixture fixture = survey(rootEntityDef("plot"));
Record record = new Record(fixture.survey, null, "plot");
EntityDefinition rootEntityDef = fixture.survey.getSchema().getRootEntityDefinition("plot");
Entity rootEntity = new Entity(rootEntityDef);
record.replaceRootEntity(rootEntity);
assertSame(rootEntity, record.getRootEntity());
}
Aggregations