public static MessageSubscriptionRecordStream messageSubscriptionRecords( final MessageSubscriptionIntent intent) { return messageSubscriptionRecords().withIntent(intent); }
public static MessageSubscriptionRecordStream messageSubscriptionRecords( final MessageSubscriptionIntent intent) { return messageSubscriptionRecords().withIntent(intent); }
@Test public void shouldCorrelateMessageSubscription() { // given final long workflowInstanceKey = testClient.createWorkflowInstance(PROCESS_ID, asMsgPack("orderId", "order-123")); final Record<WorkflowInstanceRecordValue> catchEventEntered = testClient.receiveElementInState("receive-message", enteredState); // when testClient.publishMessage("order canceled", "order-123", asMsgPack("foo", "bar")); // then final Record<MessageSubscriptionRecordValue> subscription = testClient .receiveMessageSubscriptions() .withIntent(MessageSubscriptionIntent.CORRELATED) .getFirst(); assertThat(subscription.getMetadata().getValueType()).isEqualTo(ValueType.MESSAGE_SUBSCRIPTION); assertThat(subscription.getMetadata().getRecordType()).isEqualTo(RecordType.EVENT); assertMessageSubscription(workflowInstanceKey, catchEventEntered, subscription); }
@Test public void shouldCorrelateMessageSubscription() { // given final long workflowInstanceKey = testClient.createWorkflowInstance(PROCESS_ID, asMsgPack("orderId", "order-123")); final Record<WorkflowInstanceRecordValue> catchEventEntered = testClient.receiveElementInState("receive-message", enteredState); // when testClient.publishMessage("order canceled", "order-123", asMsgPack("foo", "bar")); // then final Record<MessageSubscriptionRecordValue> subscription = testClient .receiveMessageSubscriptions() .withIntent(MessageSubscriptionIntent.CORRELATED) .getFirst(); assertThat(subscription.getMetadata().getValueType()).isEqualTo(ValueType.MESSAGE_SUBSCRIPTION); assertThat(subscription.getMetadata().getRecordType()).isEqualTo(RecordType.EVENT); assertMessageSubscription(workflowInstanceKey, catchEventEntered, subscription); }