public MessageStartEventSubscriptionRecordStream withStartEventId(String startEventId) { return valueFilter(v -> startEventId.equals(v.getStartEventId())); }
public MessageStartEventSubscriptionRecordStream withStartEventId(String startEventId) { return valueFilter(v -> startEventId.equals(v.getStartEventId())); }
/** * Verifies that the actual MessageStartEventSubscriptionRecordValue's startEventId is equal to the given one. * @param startEventId the given startEventId to compare the actual MessageStartEventSubscriptionRecordValue's startEventId to. * @return this assertion object. * @throws AssertionError - if the actual MessageStartEventSubscriptionRecordValue's startEventId is not equal to the given one. */ public S hasStartEventId(String startEventId) { // check that actual MessageStartEventSubscriptionRecordValue we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one String assertjErrorMessage = "\nExpecting startEventId of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // null safe check String actualStartEventId = actual.getStartEventId(); if (!Objects.areEqual(actualStartEventId, startEventId)) { failWithMessage(assertjErrorMessage, actual, startEventId, actualStartEventId); } // return the current assertion for method chaining return myself; }
@Test public void shouldOpenMessageSubscriptionOnDeployment() { // when testClient.deploy(createWorkflowWithOneMessageStartEvent()); final Record<MessageStartEventSubscriptionRecordValue> subscription = RecordingExporter.messageStartEventSubscriptionRecords( MessageStartEventSubscriptionIntent.OPENED) .getFirst(); // then assertThat(subscription.getValue().getStartEventId()).isEqualTo(EVENT_ID1); assertThat(subscription.getValue().getMessageName()).isEqualTo(MESSAGE_NAME1); }
@Test public void shouldOpenMessageSubscriptionOnDeployment() { // when testClient.deploy(createWorkflowWithOneMessageStartEvent()); final Record<MessageStartEventSubscriptionRecordValue> subscription = RecordingExporter.messageStartEventSubscriptionRecords( MessageStartEventSubscriptionIntent.OPENED) .getFirst(); // then assertThat(subscription.getValue().getStartEventId()).isEqualTo(EVENT_ID1); assertThat(subscription.getValue().getMessageName()).isEqualTo(MESSAGE_NAME1); }
@Test public void shouldOpenSubscriptionsForAllMessageStartEvents() { // when testClient.deploy(createWorkflowWithTwoMessageStartEvent()); final List<Record<MessageStartEventSubscriptionRecordValue>> subscriptions = RecordingExporter.messageStartEventSubscriptionRecords( MessageStartEventSubscriptionIntent.OPENED) .limit(2) .asList(); // then assertThat(subscriptions.size()).isEqualTo(2); assertThat(subscriptions) .hasSize(2) .extracting(Record::getValue) .extracting(s -> tuple(s.getMessageName(), s.getStartEventId())) .containsExactlyInAnyOrder( tuple(MESSAGE_NAME1, EVENT_ID1), tuple(MESSAGE_NAME2, EVENT_ID2)); }
@Test public void shouldOpenSubscriptionsForAllMessageStartEvents() { // when testClient.deploy(createWorkflowWithTwoMessageStartEvent()); final List<Record<MessageStartEventSubscriptionRecordValue>> subscriptions = RecordingExporter.messageStartEventSubscriptionRecords( MessageStartEventSubscriptionIntent.OPENED) .limit(2) .asList(); // then assertThat(subscriptions.size()).isEqualTo(2); assertThat(subscriptions) .hasSize(2) .extracting(Record::getValue) .extracting(s -> tuple(s.getMessageName(), s.getStartEventId())) .containsExactlyInAnyOrder( tuple(MESSAGE_NAME1, EVENT_ID1), tuple(MESSAGE_NAME2, EVENT_ID2)); }
@Test public void shouldOpenMessageStartEventSubscriptionOnAllPartitions() { testClient.deploy(createWorkflowWithOneMessageStartEvent()); final List<Record<MessageStartEventSubscriptionRecordValue>> subscriptions = RecordingExporter.messageStartEventSubscriptionRecords( MessageStartEventSubscriptionIntent.OPENED) .limit(3) .asList(); assertThat(subscriptions) .hasSize(3) .extracting(Record::getValue) .extracting(v -> tuple(v.getStartEventId(), v.getMessageName())) .containsOnly(tuple(EVENT_ID1, MESSAGE_NAME1)); assertThat(subscriptions) .extracting(r -> r.getMetadata().getPartitionId()) .containsExactlyInAnyOrder(0, 1, 2); }
@Test public void shouldOpenMessageStartEventSubscriptionOnAllPartitions() { testClient.deploy(createWorkflowWithOneMessageStartEvent()); final List<Record<MessageStartEventSubscriptionRecordValue>> subscriptions = RecordingExporter.messageStartEventSubscriptionRecords( MessageStartEventSubscriptionIntent.OPENED) .limit(3) .asList(); assertThat(subscriptions) .hasSize(3) .extracting(Record::getValue) .extracting(v -> tuple(v.getStartEventId(), v.getMessageName())) .containsOnly(tuple(EVENT_ID1, MESSAGE_NAME1)); assertThat(subscriptions) .extracting(r -> r.getMetadata().getPartitionId()) .containsExactlyInAnyOrder(0, 1, 2); }