@Test public void convertToAPIShouldCreateAPIEventAndCallEventContextInfoAppender() { ProcessStartedAuditEventEntity auditEventEntity = new ProcessStartedAuditEventEntity(); CloudProcessStartedEventImpl apiEvent = new CloudProcessStartedEventImpl(); doReturn(apiEvent).when(eventConverter).createAPIEvent(auditEventEntity); CloudProcessStartedEventImpl updatedApiEvent = new CloudProcessStartedEventImpl(); given(eventContextInfoAppender.addProcessContextInfoToApiEvent(apiEvent, auditEventEntity)).willReturn(updatedApiEvent); CloudRuntimeEvent convertedEvent = eventConverter.convertToAPI(auditEventEntity); assertThat(convertedEvent).isEqualTo(updatedApiEvent); verify(eventContextInfoAppender).addProcessContextInfoToApiEvent(apiEvent, auditEventEntity); }
@Override protected CloudRuntimeEventImpl<?, ?> createAPIEvent(AuditEventEntity auditEventEntity) { ProcessStartedAuditEventEntity processStartedAuditEventEntity = (ProcessStartedAuditEventEntity) auditEventEntity; return new CloudProcessStartedEventImpl(processStartedAuditEventEntity.getEventId(), processStartedAuditEventEntity.getTimestamp(), processStartedAuditEventEntity.getProcessInstance()); }
ProcessStartedEventConverter extends BaseEventToEntityConverter { @Override protected CloudRuntimeEventImpl<?, ?> createAPIEvent(AuditEventEntity auditEventEntity) { ProcessStartedAuditEventEntity processStartedAuditEventEntity = (ProcessStartedAuditEventEntity) auditEventEntity; return new CloudProcessStartedEventImpl(processStartedAuditEventEntity.getEventId(), processStartedAuditEventEntity.getTimestamp(), processStartedAuditEventEntity.getProcessInstance()); } }
ProcessStartedEventConverter extends BaseEventToEntityConverter { @Override protected CloudRuntimeEventImpl<?, ?> createAPIEvent(AuditEventEntity auditEventEntity) { ProcessStartedAuditEventEntity processStartedAuditEventEntity = (ProcessStartedAuditEventEntity) auditEventEntity; return new CloudProcessStartedEventImpl(processStartedAuditEventEntity.getEventId(), processStartedAuditEventEntity.getTimestamp(), processStartedAuditEventEntity.getProcessInstance()); } ProcessStartedEventConverter(EventContextInfoAppender eventContextInfoAppender); }
ProcessStartedEventConverter extends BaseEventToEntityConverter { @Override protected CloudRuntimeEventImpl<?, ?> createAPIEvent(AuditEventEntity auditEventEntity) { ProcessStartedAuditEventEntity processStartedAuditEventEntity = (ProcessStartedAuditEventEntity) auditEventEntity; return new CloudProcessStartedEventImpl(processStartedAuditEventEntity.getEventId(), processStartedAuditEventEntity.getTimestamp(), processStartedAuditEventEntity.getProcessInstance()); } ProcessStartedEventConverter(EventContextInfoAppender eventContextInfoAppender); @Override String getSupportedEvent(); }
ProcessStartedEventConverter extends BaseEventToEntityConverter { @Override protected CloudRuntimeEventImpl<?, ?> createAPIEvent(AuditEventEntity auditEventEntity) { ProcessStartedAuditEventEntity processStartedAuditEventEntity = (ProcessStartedAuditEventEntity) auditEventEntity; return new CloudProcessStartedEventImpl(processStartedAuditEventEntity.getEventId(), processStartedAuditEventEntity.getTimestamp(), processStartedAuditEventEntity.getProcessInstance()); } ProcessStartedEventConverter(EventContextInfoAppender eventContextInfoAppender); @Override String getSupportedEvent();  }