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