use of org.activiti.api.runtime.model.impl.BPMNTimerImpl in project Activiti by Activiti.
the class ToTimerScheduledConverterTest 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
BPMNTimerScheduledEvent 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);
}
use of org.activiti.api.runtime.model.impl.BPMNTimerImpl in project Activiti by Activiti.
the class ToTimerFailedConverterTest 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
BPMNTimerFailedEvent 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);
}
Aggregations