Search in sources :

Example 1 with BPMNTimerRetriesDecrementedEvent

use of org.activiti.api.process.model.events.BPMNTimerRetriesDecrementedEvent in project Activiti by Activiti.

the class ToTimerRetriesDecrementedConverterTest method shouldReturnConvertedEventsWhenInternalEvenIsRelatedToTimers.

@Test
public void shouldReturnConvertedEventsWhenInternalEvenIsRelatedToTimers() {
    // given
    ActivitiEntityEvent internalEvent = mock(ActivitiEntityEvent.class);
    given(internalEvent.getProcessDefinitionId()).willReturn("procDefId");
    given(internalEvent.getProcessInstanceId()).willReturn("procInstId");
    BPMNTimerImpl bpmnTimer = new BPMNTimerImpl("myTimer");
    given(bpmnTimerConverter.convertToBPMNTimer(internalEvent)).willReturn(bpmnTimer);
    given(bpmnTimerConverter.isTimerRelatedEvent(internalEvent)).willReturn(true);
    // when
    BPMNTimerRetriesDecrementedEvent timerEvent = toTimerConverter.from(internalEvent).orElse(null);
    // then
    assertThat(timerEvent).isNotNull();
    assertThat(timerEvent.getProcessInstanceId()).isEqualTo("procInstId");
    assertThat(timerEvent.getProcessDefinitionId()).isEqualTo("procDefId");
    assertThat(timerEvent.getEntity()).isEqualTo(bpmnTimer);
}
Also used : ActivitiEntityEvent(org.activiti.engine.delegate.event.ActivitiEntityEvent) BPMNTimerImpl(org.activiti.api.runtime.model.impl.BPMNTimerImpl) BPMNTimerRetriesDecrementedEvent(org.activiti.api.process.model.events.BPMNTimerRetriesDecrementedEvent) Test(org.junit.jupiter.api.Test)

Aggregations

BPMNTimerRetriesDecrementedEvent (org.activiti.api.process.model.events.BPMNTimerRetriesDecrementedEvent)1 BPMNTimerImpl (org.activiti.api.runtime.model.impl.BPMNTimerImpl)1 ActivitiEntityEvent (org.activiti.engine.delegate.event.ActivitiEntityEvent)1 Test (org.junit.jupiter.api.Test)1