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