Search in sources :

Example 1 with TestFixture

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());
}
Also used : EntityDefinition(org.openforis.idm.metamodel.EntityDefinition) TestFixture(org.openforis.idm.testfixture.TestFixture) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)1 TestFixture (org.openforis.idm.testfixture.TestFixture)1