use of net.geoprism.registry.task.Task in project geoprism-registry by terraframe.
the class TransitionEventTest method testUpdateTransition.
@Test
@Request
public void testUpdateTransition() {
TransitionEvent event = new TransitionEvent();
try {
LocalizedValueConverter.populate(event, TransitionEvent.DESCRIPTION, new LocalizedValue("Test"));
event.setEventDate(FastTestDataset.DEFAULT_OVER_TIME_DATE);
event.setBeforeTypeCode(FastTestDataset.COUNTRY.getCode());
event.setBeforeTypeOrgCode(FastTestDataset.COUNTRY.getOrganization().getCode());
event.setAfterTypeCode(FastTestDataset.PROVINCE.getCode());
event.setAfterTypeOrgCode(FastTestDataset.PROVINCE.getOrganization().getCode());
event.apply();
Transition transition = event.addTransition(FastTestDataset.CAMBODIA.getServerObject(), FastTestDataset.PROV_CENTRAL.getServerObject(), TransitionType.REASSIGN, TransitionImpact.FULL);
transition.apply(event, transition.getOrder(), (VertexServerGeoObject) FastTestDataset.CAMBODIA.getServerObject(), (VertexServerGeoObject) FastTestDataset.PROV_WESTERN.getServerObject());
List<Task> tasks = Task.getTasks(transition.getOid());
Assert.assertEquals(6, tasks.size());
} finally {
event.delete();
}
}
Aggregations