Search in sources :

Example 1 with MessageSubscriptionImpl

use of org.activiti.api.runtime.model.impl.MessageSubscriptionImpl in project Activiti by Activiti.

the class MessageSubscriptionConverterTest method convertShouldReturnBPMNMessage.

@Test
public void convertShouldReturnBPMNMessage() {
    MessageEventSubscriptionEntity entity = mock(MessageEventSubscriptionEntity.class);
    given(entity.getConfiguration()).willReturn("correlationKey");
    given(entity.getEventName()).willReturn("messageName");
    given(entity.getProcessDefinitionId()).willReturn("procDefId");
    given(entity.getProcessInstanceId()).willReturn("procInstId");
    MessageSubscriptionImpl messageSubscription = converter.convertToMessageSubscription(entity);
    // then
    assertThat(messageSubscription).isNotNull();
    assertThat(messageSubscription.getProcessInstanceId()).isEqualTo("procInstId");
    assertThat(messageSubscription.getProcessDefinitionId()).isEqualTo("procDefId");
    assertThat(messageSubscription.getConfiguration()).isEqualTo("correlationKey");
    assertThat(messageSubscription.getEventName()).isEqualTo("messageName");
}
Also used : MessageSubscriptionImpl(org.activiti.api.runtime.model.impl.MessageSubscriptionImpl) MessageEventSubscriptionEntity(org.activiti.engine.impl.persistence.entity.MessageEventSubscriptionEntity) Test(org.junit.jupiter.api.Test)

Aggregations

MessageSubscriptionImpl (org.activiti.api.runtime.model.impl.MessageSubscriptionImpl)1 MessageEventSubscriptionEntity (org.activiti.engine.impl.persistence.entity.MessageEventSubscriptionEntity)1 Test (org.junit.jupiter.api.Test)1