use of org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl in project activiti-cloud by Activiti.
the class MessageSubscriptionCancelledEventConverterTest method should_convertToAPIErrorReceivedEvent.
@Test
public void should_convertToAPIErrorReceivedEvent() {
// given
MessageSubscriptionCancelledAuditEventEntity auditEventEntity = (MessageSubscriptionCancelledAuditEventEntity) eventConverter.convertToEntity(createMessageSubscriptionCancelledEvent());
CloudMessageSubscriptionCancelledEventImpl event = (CloudMessageSubscriptionCancelledEventImpl) eventConverter.convertToAPI(auditEventEntity);
assertThatIsEqualTo(auditEventEntity, event);
}
use of org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl in project activiti-cloud by Activiti.
the class MessageSubscriptionCancelledEventConverterTest method should_convert_toEntityMessageSubscriptionCancelledEvent.
@Test
public void should_convert_toEntityMessageSubscriptionCancelledEvent() {
CloudMessageSubscriptionCancelledEventImpl event = createMessageSubscriptionCancelledEvent();
MessageSubscriptionCancelledAuditEventEntity auditEventEntity = (MessageSubscriptionCancelledAuditEventEntity) eventConverter.convertToEntity(event);
assertThatIsEqualTo(auditEventEntity, event);
}
use of org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl in project activiti-cloud by Activiti.
the class CloudRuntimeEventRegistry method buildRegistry.
public Map<String, Class<?>> buildRegistry() {
List<RuntimeEvent<?, ?>> eventImplementations = new ArrayList<>();
eventImplementations.add(new CloudBPMNActivityStartedEventImpl());
eventImplementations.add(new CloudBPMNActivityCancelledEventImpl());
eventImplementations.add(new CloudBPMNActivityCompletedEventImpl());
eventImplementations.add(new CloudBPMNErrorReceivedEventImpl());
eventImplementations.add(new CloudBPMNSignalReceivedEventImpl());
eventImplementations.add(new CloudBPMNTimerFiredEventImpl());
eventImplementations.add(new CloudBPMNTimerCancelledEventImpl());
eventImplementations.add(new CloudBPMNTimerScheduledEventImpl());
eventImplementations.add(new CloudBPMNTimerExecutedEventImpl());
eventImplementations.add(new CloudBPMNTimerFailedEventImpl());
eventImplementations.add(new CloudBPMNTimerRetriesDecrementedEventImpl());
eventImplementations.add(new CloudBPMNMessageWaitingEventImpl());
eventImplementations.add(new CloudBPMNMessageReceivedEventImpl());
eventImplementations.add(new CloudBPMNMessageSentEventImpl());
eventImplementations.add(new CloudIntegrationRequestedEventImpl());
eventImplementations.add(new CloudIntegrationResultReceivedEventImpl());
eventImplementations.add(new CloudIntegrationErrorReceivedEventImpl());
eventImplementations.add(new CloudProcessDeployedEventImpl());
eventImplementations.add(new CloudProcessCreatedEventImpl());
eventImplementations.add(new CloudProcessStartedEventImpl());
eventImplementations.add(new CloudProcessCompletedEventImpl());
eventImplementations.add(new CloudProcessCancelledEventImpl());
eventImplementations.add(new CloudProcessSuspendedEventImpl());
eventImplementations.add(new CloudProcessResumedEventImpl());
eventImplementations.add(new CloudProcessUpdatedEventImpl());
eventImplementations.add(new CloudSequenceFlowTakenEventImpl());
eventImplementations.add(new CloudStartMessageDeployedEventImpl());
eventImplementations.add(new CloudMessageSubscriptionCancelledEventImpl());
eventImplementations.add(new CloudTaskCreatedEventImpl());
eventImplementations.add(new CloudTaskUpdatedEventImpl());
eventImplementations.add(new CloudTaskAssignedEventImpl());
eventImplementations.add(new CloudTaskCompletedEventImpl());
eventImplementations.add(new CloudTaskSuspendedEventImpl());
eventImplementations.add(new CloudTaskActivatedEventImpl());
eventImplementations.add(new CloudTaskCancelledEventImpl());
eventImplementations.add(new CloudTaskCandidateUserAddedEventImpl());
eventImplementations.add(new CloudTaskCandidateUserRemovedEventImpl());
eventImplementations.add(new CloudTaskCandidateGroupAddedEventImpl());
eventImplementations.add(new CloudTaskCandidateGroupRemovedEventImpl());
eventImplementations.add(new CloudVariableCreatedEventImpl());
eventImplementations.add(new CloudVariableUpdatedEventImpl());
eventImplementations.add(new CloudVariableDeletedEventImpl());
return eventImplementations.stream().collect(Collectors.toMap(event -> event.getEventType().name(), this::findInterface));
}
use of org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl in project activiti-cloud by Activiti.
the class AuditServiceIT method shouldGetMessageSubscriptionCancelledEvent.
@Test
public void shouldGetMessageSubscriptionCancelledEvent() {
// given
List<CloudRuntimeEvent> coveredEvents = new ArrayList<>();
MessageSubscriptionImpl messageSubscription = MessageSubscriptionImpl.builder().withId("entityId").withEventName("messageName").withConfiguration("correlationKey").withProcessDefinitionId("processDefinitionId").withProcessInstanceId("processInstanceId").withBusinessKey("businessKey").build();
CloudMessageSubscriptionCancelledEventImpl cloudEvent = CloudMessageSubscriptionCancelledEventImpl.builder().withEntity(messageSubscription).build();
coveredEvents.add(cloudEvent);
producer.send(coveredEvents.toArray(new CloudRuntimeEvent[coveredEvents.size()]));
await().untilAsserted(() -> {
// when
Map<String, Object> filters = new HashMap<>();
filters.put("eventType", MessageSubscriptionCancelledEvent.MessageSubscriptionEvents.MESSAGE_SUBSCRIPTION_CANCELLED.name());
ResponseEntity<PagedResources<CloudRuntimeEvent>> eventsPagedResources = eventsRestTemplate.executeFind(filters);
// then
Collection<CloudRuntimeEvent> retrievedEvents = eventsPagedResources.getBody().getContent();
assertThat(retrievedEvents).hasSize(1);
assertThat(retrievedEvents).extracting(CloudRuntimeEvent::getEventType, CloudRuntimeEvent::getServiceName, CloudRuntimeEvent::getServiceVersion, CloudRuntimeEvent::getProcessInstanceId, CloudRuntimeEvent::getProcessDefinitionId, CloudRuntimeEvent::getEntityId, event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getId(), event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getProcessInstanceId(), event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getProcessDefinitionId(), event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getEventName(), event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getConfiguration(), event -> ((CloudMessageSubscriptionCancelledEvent) event).getEntity().getBusinessKey()).contains(tuple(cloudEvent.getEventType(), cloudEvent.getServiceName(), cloudEvent.getServiceVersion(), cloudEvent.getProcessInstanceId(), cloudEvent.getProcessDefinitionId(), cloudEvent.getEntityId(), cloudEvent.getEntity().getId(), cloudEvent.getEntity().getProcessInstanceId(), cloudEvent.getEntity().getProcessDefinitionId(), cloudEvent.getEntity().getEventName(), cloudEvent.getEntity().getConfiguration(), cloudEvent.getEntity().getBusinessKey()));
});
}
use of org.activiti.cloud.api.process.model.impl.events.CloudMessageSubscriptionCancelledEventImpl in project activiti-cloud by Activiti.
the class MessageSubscriptionCancelledEventConverterTest method createMessageSubscriptionCancelledEvent.
private CloudMessageSubscriptionCancelledEventImpl createMessageSubscriptionCancelledEvent() {
// given
ProcessInstanceImpl processInstanceStarted = new ProcessInstanceImpl();
processInstanceStarted.setId("processInstanceId");
processInstanceStarted.setProcessDefinitionId("processDefinitionId");
processInstanceStarted.setProcessDefinitionKey("processDefinitionKey");
processInstanceStarted.setBusinessKey("businessKey");
processInstanceStarted.setParentId("parentId");
MessageSubscription messageSubscription = MessageSubscriptionImpl.builder().withId("entityId").withEventName("messageName").withConfiguration("correlationKey").withProcessDefinitionId(processInstanceStarted.getProcessDefinitionId()).withProcessInstanceId(processInstanceStarted.getId()).withBusinessKey(processInstanceStarted.getBusinessKey()).build();
CloudMessageSubscriptionCancelledEventImpl event = CloudMessageSubscriptionCancelledEventImpl.builder().withEntity(messageSubscription).build();
// Set explicitly to be sure
event.setEntityId("entityId");
event.setProcessInstanceId(processInstanceStarted.getId());
event.setProcessDefinitionId(processInstanceStarted.getProcessDefinitionId());
event.setProcessDefinitionKey(processInstanceStarted.getProcessDefinitionKey());
event.setBusinessKey(processInstanceStarted.getBusinessKey());
event.setParentProcessInstanceId(processInstanceStarted.getParentId());
event.setMessageId("message-id");
event.setSequenceNumber(0);
return event;
}
Aggregations