use of org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl in project activiti-cloud by Activiti.
the class ErrorReceivedEventConverterTest method should_convert_toEntityErrorReceivedEvent.
@Test
public void should_convert_toEntityErrorReceivedEvent() {
CloudBPMNErrorReceivedEventImpl event = createErrorReceivedEvent();
ErrorReceivedAuditEventEntity auditEventEntity = (ErrorReceivedAuditEventEntity) eventConverter.convertToEntity(event);
assertThatIsEqualTo(auditEventEntity, event);
}
use of org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl in project activiti-cloud by Activiti.
the class ErrorReceivedEventConverterTest method createErrorReceivedEvent.
private CloudBPMNErrorReceivedEventImpl createErrorReceivedEvent() {
// given
ProcessInstanceImpl processInstanceStarted = new ProcessInstanceImpl();
processInstanceStarted.setId("processInstanceId");
processInstanceStarted.setProcessDefinitionId("processDefinitionId");
processInstanceStarted.setProcessDefinitionKey("processDefinitionKey");
processInstanceStarted.setBusinessKey("businessKey");
processInstanceStarted.setParentId("parentId");
BPMNErrorImpl error = new BPMNErrorImpl("entityId");
error.setProcessDefinitionId(processInstanceStarted.getProcessDefinitionId());
error.setProcessInstanceId(processInstanceStarted.getId());
error.setErrorId("errorId");
error.setErrorCode("errorCode");
CloudBPMNErrorReceivedEventImpl event = new CloudBPMNErrorReceivedEventImpl("eventId", System.currentTimeMillis(), error, error.getProcessDefinitionId(), error.getProcessInstanceId());
// 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;
}
use of org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl in project activiti-cloud by Activiti.
the class ErrorReceivedEventConverterTest method should_convertToAPIErrorReceivedEvent.
@Test
public void should_convertToAPIErrorReceivedEvent() {
// given
ErrorReceivedAuditEventEntity auditEventEntity = (ErrorReceivedAuditEventEntity) eventConverter.convertToEntity(createErrorReceivedEvent());
CloudBPMNErrorReceivedEventImpl event = (CloudBPMNErrorReceivedEventImpl) eventConverter.convertToAPI(auditEventEntity);
assertThatIsEqualTo(auditEventEntity, event);
}
use of org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl in project activiti-cloud by Activiti.
the class ToCloudProcessRuntimeEventConverter method from.
public CloudBPMNErrorReceivedEvent from(BPMNErrorReceivedEvent event) {
CloudBPMNErrorReceivedEventImpl cloudEvent = new CloudBPMNErrorReceivedEventImpl(event.getEntity(), event.getEntity().getProcessDefinitionId(), event.getEntity().getProcessInstanceId());
runtimeBundleInfoAppender.appendRuntimeBundleInfoTo(cloudEvent);
return cloudEvent;
}
use of org.activiti.cloud.api.process.model.impl.events.CloudBPMNErrorReceivedEventImpl in project activiti-cloud by Activiti.
the class CloudErrorProducerTest method shouldConvertErrorReceivedEventToCloudEventAndAddToAggregator.
@Test
public void shouldConvertErrorReceivedEventToCloudEventAndAddToAggregator() {
BPMNErrorReceivedEvent eventFired = new BPMNErrorReceivedEventImpl(new BPMNErrorImpl());
CloudBPMNErrorReceivedEvent cloudEventFired = new CloudBPMNErrorReceivedEventImpl();
given(eventConverter.from(eventFired)).willReturn(cloudEventFired);
cloudErrorReceivedProducer.onEvent(eventFired);
verify(eventsAggregator).add(cloudEventFired);
}
Aggregations