use of org.activiti.api.process.model.events.MessageSubscriptionCancelledEvent in project Activiti by Activiti.
the class ProcessRuntimeBPMNMessageIT method should_getMessageSubscriptionCancelledEvent_when_processIsDeleted.
@Test
public void should_getMessageSubscriptionCancelledEvent_when_processIsDeleted() {
// when
ProcessInstance process = processRuntime.start(ProcessPayloadBuilder.start().withBusinessKey("businessKey").withVariable("correlationKey", "correlationKey").withProcessDefinitionKey(CATCH_MESSAGE).build());
// then
assertThat(MessageTestConfiguration.messageEvents).isNotEmpty().extracting(BPMNMessageEvent::getEventType, BPMNMessageEvent::getProcessDefinitionId, BPMNMessageEvent::getProcessInstanceId, event -> event.getEntity().getProcessDefinitionId(), event -> event.getEntity().getProcessInstanceId(), event -> event.getEntity().getMessagePayload().getName(), event -> event.getEntity().getMessagePayload().getCorrelationKey(), event -> event.getEntity().getMessagePayload().getBusinessKey(), event -> event.getEntity().getMessagePayload().getVariables()).contains(Tuple.tuple(BPMNMessageEvent.MessageEvents.MESSAGE_WAITING, process.getProcessDefinitionId(), process.getId(), process.getProcessDefinitionId(), process.getId(), "testMessage", "correlationKey", process.getBusinessKey(), null));
// when
processRuntime.delete(ProcessPayloadBuilder.delete(process.getId()));
// then
assertThat(MessageTestConfiguration.messageSubscriptionCancelledEvents).isNotEmpty().extracting(MessageSubscriptionCancelledEvent::getEventType, MessageSubscriptionCancelledEvent::getProcessDefinitionId, MessageSubscriptionCancelledEvent::getProcessInstanceId, event -> event.getEntity().getProcessDefinitionId(), event -> event.getEntity().getProcessInstanceId(), event -> event.getEntity().getEventName(), event -> event.getEntity().getConfiguration(), event -> event.getEntity().getBusinessKey()).contains(Tuple.tuple(MessageSubscriptionEvent.MessageSubscriptionEvents.MESSAGE_SUBSCRIPTION_CANCELLED, process.getProcessDefinitionId(), process.getId(), process.getProcessDefinitionId(), process.getId(), "testMessage", "correlationKey", process.getBusinessKey()));
}
Aggregations