use of org.camunda.bpm.engine.runtime.EventSubscription in project camunda-bpm-platform by camunda.
the class MigrationReceiveTaskTest method testMigrateEventSubscriptionProperties.
@Test
public void testMigrateEventSubscriptionProperties() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(MessageReceiveModels.ONE_RECEIVE_TASK_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(MessageReceiveModels.ONE_RECEIVE_TASK_PROCESS);
MigrationPlan migrationPlan = rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("receiveTask", "receiveTask").build();
// when
testHelper.createProcessInstanceAndMigrate(migrationPlan);
// then
EventSubscription eventSubscriptionBefore = testHelper.snapshotBeforeMigration.getEventSubscriptions().get(0);
List<EventSubscription> eventSubscriptionsAfter = testHelper.snapshotAfterMigration.getEventSubscriptions();
Assert.assertEquals(1, eventSubscriptionsAfter.size());
EventSubscription eventSubscriptionAfter = eventSubscriptionsAfter.get(0);
Assert.assertEquals(eventSubscriptionBefore.getCreated(), eventSubscriptionAfter.getCreated());
Assert.assertEquals(eventSubscriptionBefore.getExecutionId(), eventSubscriptionAfter.getExecutionId());
Assert.assertEquals(eventSubscriptionBefore.getProcessInstanceId(), eventSubscriptionAfter.getProcessInstanceId());
}
use of org.camunda.bpm.engine.runtime.EventSubscription in project camunda-bpm-platform by camunda.
the class MigrationTestRule method assertEventSubscriptionMigrated.
public void assertEventSubscriptionMigrated(String activityIdBefore, String eventNameBefore, String activityIdAfter, String eventNameAfter) {
EventSubscription eventSubscriptionBefore = snapshotBeforeMigration.getEventSubscriptionForActivityIdAndEventName(activityIdBefore, eventNameBefore);
assertNotNull("Expected that an event subscription for activity '" + activityIdBefore + "' exists before migration", eventSubscriptionBefore);
assertEventSubscriptionMigrated(eventSubscriptionBefore, activityIdAfter, eventNameAfter);
}
use of org.camunda.bpm.engine.runtime.EventSubscription in project camunda-bpm-platform by camunda.
the class MigrationMessageStartEventTest method assertEventSubscriptionMigrated.
protected void assertEventSubscriptionMigrated(EventSubscription eventSubscriptionBefore, String activityIdAfter, String eventName) {
EventSubscription eventSubscriptionAfter = runtimeService.createEventSubscriptionQuery().singleResult();
assertNotNull("Expected that an event subscription with id '" + eventSubscriptionBefore.getId() + "' " + "exists after migration", eventSubscriptionAfter);
assertEquals(eventSubscriptionBefore.getEventType(), eventSubscriptionAfter.getEventType());
assertEquals(activityIdAfter, eventSubscriptionAfter.getActivityId());
assertEquals(eventName, eventSubscriptionAfter.getEventName());
}
use of org.camunda.bpm.engine.runtime.EventSubscription in project camunda-bpm-platform by camunda.
the class MigrationTestRule method assertEventSubscriptionCreated.
public void assertEventSubscriptionCreated(String activityId, String eventName) {
EventSubscription eventSubscriptionAfter = snapshotAfterMigration.getEventSubscriptionForActivityIdAndEventName(activityId, eventName);
assertNotNull("Expected an event subscription for activity '" + activityId + "' after the migration", eventSubscriptionAfter);
for (EventSubscription eventSubscription : snapshotBeforeMigration.getEventSubscriptions()) {
if (eventSubscriptionAfter.getId().equals(eventSubscription.getId())) {
fail("Expected event subscription '" + eventSubscriptionAfter.getId() + "' to be created after migration");
}
}
}
use of org.camunda.bpm.engine.runtime.EventSubscription in project camunda-bpm-platform by camunda.
the class MultiTenancyStartProcessInstanceByConditionCmdTenantCheckTest method ensureEventSubscriptions.
protected void ensureEventSubscriptions(int count) {
List<EventSubscription> eventSubscriptions = engineRule.getRuntimeService().createEventSubscriptionQuery().list();
assertEquals(count, eventSubscriptions.size());
for (EventSubscription eventSubscription : eventSubscriptions) {
assertEquals(EventType.CONDITONAL.name(), eventSubscription.getEventType());
}
}
Aggregations