use of org.activiti.api.process.model.events.BPMNMessageReceivedEvent in project Activiti by Activiti.
the class ToMessageReceivedConverterTest method fromShouldReturnConvertedEventAndSetProcessInstanceIdAndProcessDefinitionId.
@Test
public void fromShouldReturnConvertedEventAndSetProcessInstanceIdAndProcessDefinitionId() {
// given
ActivitiMessageEvent internalEvent = mock(ActivitiMessageEvent.class);
given(internalEvent.getProcessDefinitionId()).willReturn("procDefId");
given(internalEvent.getProcessInstanceId()).willReturn("procInstId");
BPMNMessageImpl bpmnMessage = new BPMNMessageImpl("myMessage");
given(bpmnMessageConverter.convertToBPMNMessage(internalEvent)).willReturn(bpmnMessage);
// when
BPMNMessageReceivedEvent messageEvent = toMessageConverter.from(internalEvent).orElse(null);
// then
assertThat(messageEvent).isNotNull();
assertThat(messageEvent.getProcessInstanceId()).isEqualTo("procInstId");
assertThat(messageEvent.getProcessDefinitionId()).isEqualTo("procDefId");
assertThat(messageEvent.getEntity()).isEqualTo(bpmnMessage);
}
Aggregations