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