use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationPlanCreationTest method testMigrateNullSourceActivityId.
@Test
public void testMigrateNullSourceActivityId() {
ProcessDefinition sourceDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
ProcessDefinition targetDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
try {
runtimeService.createMigrationPlan(sourceDefinition.getId(), targetDefinition.getId()).mapActivities(null, "userTask").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures(null, "Source activity id is null");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationPlanCreationTest method testMigrateToUnsupportedActivityType.
@Test
public void testMigrateToUnsupportedActivityType() {
ProcessDefinition sourceDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
ProcessDefinition targetDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_RECEIVE_TASK_PROCESS);
try {
runtimeService.createMigrationPlan(sourceDefinition.getId(), targetDefinition.getId()).mapActivities("userTask", "receiveTask").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures("userTask", "Activities have incompatible types (UserTaskActivityBehavior is not compatible with ReceiveTaskActivityBehavior)");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationPlanCreationTest method testMigrateNullTargetActivityId.
@Test
public void testMigrateNullTargetActivityId() {
ProcessDefinition sourceDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
ProcessDefinition targetDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
try {
runtimeService.createMigrationPlan(sourceDefinition.getId(), targetDefinition.getId()).mapActivities("userTask", null).build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures("userTask", "Target activity id is null");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationPlanCreationTest method testNotMapActivitiesMoreThanOnce.
@Test
public void testNotMapActivitiesMoreThanOnce() {
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.PARALLEL_GATEWAY_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.PARALLEL_GATEWAY_PROCESS);
try {
runtimeService.createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("userTask1", "userTask1").mapActivities("userTask1", "userTask2").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures("userTask1", "There are multiple mappings for source activity id 'userTask1'", "There are multiple mappings for source activity id 'userTask1'");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationPlanCreationTest method testCannotUpdateEventTriggerForEventSubProcess.
@Test
public void testCannotUpdateEventTriggerForEventSubProcess() {
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(EventSubProcessModels.TIMER_EVENT_SUBPROCESS_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(EventSubProcessModels.TIMER_EVENT_SUBPROCESS_PROCESS);
try {
runtimeService.createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("eventSubProcess", "eventSubProcess").updateEventTrigger().build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures("eventSubProcess", "Cannot update event trigger because the activity does not define a persistent event trigger");
}
}
Aggregations