@Test public void shouldReturnEmptyOptionalWhenInternalEventIsNotRelatedToTimers() { given(bpmnTimerConverter.isTimerRelatedEvent(mock(ActivitiEntityEvent.class))).willReturn(false); Optional<BPMNTimerCancelledEvent> optional = toTimerCancelledConverter.from(mock(ActivitiEntityEvent.class)); assertThat(optional).isEmpty(); }
@Override public Optional<BPMNTimerCancelledEvent> from(ActivitiEvent internalEvent) { BPMNTimerCancelledEventImpl event = null; if (bpmnTimerConverter.isTimerRelatedEvent(internalEvent)) { event = new BPMNTimerCancelledEventImpl(bpmnTimerConverter.convertToBPMNTimer((ActivitiEntityEvent) internalEvent)); event.setProcessInstanceId(internalEvent.getProcessInstanceId()); event.setProcessDefinitionId(internalEvent.getProcessDefinitionId()); } return Optional.ofNullable(event); }
ToTimerCancelledConverter implements EventConverter<BPMNTimerCancelledEvent, ActivitiEvent> { @Override public Optional<BPMNTimerCancelledEvent> from(ActivitiEvent internalEvent) { BPMNTimerCancelledEventImpl event = null; if (bpmnTimerConverter.isTimerRelatedEvent(internalEvent)) { event = new BPMNTimerCancelledEventImpl(bpmnTimerConverter.convertToBPMNTimer((ActivitiEntityEvent) internalEvent)); event.setProcessInstanceId(internalEvent.getProcessInstanceId()); event.setProcessDefinitionId(internalEvent.getProcessDefinitionId()); } return Optional.ofNullable(event); } }
ToTimerCancelledConverter implements EventConverter<BPMNTimerCancelledEvent, ActivitiEvent> { @Override public Optional<BPMNTimerCancelledEvent> from(ActivitiEvent internalEvent) { BPMNTimerCancelledEventImpl event = null; if (bpmnTimerConverter.isTimerRelatedEvent(internalEvent)) { event = new BPMNTimerCancelledEventImpl(bpmnTimerConverter.convertToBPMNTimer((ActivitiEntityEvent) internalEvent)); event.setProcessInstanceId(internalEvent.getProcessInstanceId()); event.setProcessDefinitionId(internalEvent.getProcessDefinitionId()); } return Optional.ofNullable(event); } ToTimerCancelledConverter(BPMNTimerConverter bpmnTimerConverter); }
ToTimerCancelledConverter implements EventConverter<BPMNTimerCancelledEvent, ActivitiEvent> { @Override public Optional<BPMNTimerCancelledEvent> from(ActivitiEvent internalEvent) { BPMNTimerCancelledEventImpl event = null; if (bpmnTimerConverter.isTimerRelatedEvent(internalEvent)) { event = new BPMNTimerCancelledEventImpl(bpmnTimerConverter.convertToBPMNTimer((ActivitiEntityEvent) internalEvent)); event.setProcessInstanceId(internalEvent.getProcessInstanceId()); event.setProcessDefinitionId(internalEvent.getProcessDefinitionId()); } return Optional.ofNullable(event); } ToTimerCancelledConverter(BPMNTimerConverter bpmnTimerConverter); @Override Optional<BPMNTimerCancelledEvent> from(ActivitiEvent internalEvent); }
ToTimerCancelledConverter implements EventConverter<BPMNTimerCancelledEvent, ActivitiEvent> { @Override public Optional<BPMNTimerCancelledEvent> from(ActivitiEvent internalEvent) { BPMNTimerCancelledEventImpl event = null; if (bpmnTimerConverter.isTimerRelatedEvent(internalEvent)) { event = new BPMNTimerCancelledEventImpl(bpmnTimerConverter.convertToBPMNTimer((ActivitiEntityEvent) internalEvent)); event.setProcessInstanceId(internalEvent.getProcessInstanceId()); event.setProcessDefinitionId(internalEvent.getProcessDefinitionId()); } return Optional.ofNullable(event); } ToTimerCancelledConverter(BPMNTimerConverter bpmnTimerConverter); @Override Optional<BPMNTimerCancelledEvent> from(ActivitiEvent internalEvent);  }