public MessageSubscriptionRecordStream withCorrelationKey(final String correlationKey) { return valueFilter(v -> correlationKey.equals(v.getCorrelationKey())); } }
public MessageSubscriptionRecordStream withElementInstanceKey(final long elementInstanceKey) { return valueFilter(v -> v.getElementInstanceKey() == elementInstanceKey); }
public MessageSubscriptionRecordStream withMessageName(final String messageName) { return valueFilter(v -> messageName.equals(v.getMessageName())); }
public MessageSubscriptionRecordStream withWorkflowInstanceKey(final long workflowInstanceKey) { return valueFilter(v -> v.getWorkflowInstanceKey() == workflowInstanceKey); }
public MessageSubscriptionRecordStream withWorkflowInstanceKey(final long workflowInstanceKey) { return valueFilter(v -> v.getWorkflowInstanceKey() == workflowInstanceKey); }
public MessageSubscriptionRecordStream withCorrelationKey(final String correlationKey) { return valueFilter(v -> correlationKey.equals(v.getCorrelationKey())); } }
public MessageSubscriptionRecordStream withElementInstanceKey(final long elementInstanceKey) { return valueFilter(v -> v.getElementInstanceKey() == elementInstanceKey); }
/** * Verifies that the actual MessageSubscriptionRecordValue's workflowInstanceKey is equal to the given one. * @param workflowInstanceKey the given workflowInstanceKey to compare the actual MessageSubscriptionRecordValue's workflowInstanceKey to. * @return this assertion object. * @throws AssertionError - if the actual MessageSubscriptionRecordValue's workflowInstanceKey is not equal to the given one. */ public S hasWorkflowInstanceKey(long workflowInstanceKey) { // check that actual MessageSubscriptionRecordValue we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one String assertjErrorMessage = "\nExpecting workflowInstanceKey of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // check long actualWorkflowInstanceKey = actual.getWorkflowInstanceKey(); if (actualWorkflowInstanceKey != workflowInstanceKey) { failWithMessage(assertjErrorMessage, actual, workflowInstanceKey, actualWorkflowInstanceKey); } // return the current assertion for method chaining return myself; }
public MessageSubscriptionRecordStream withMessageName(final String messageName) { return valueFilter(v -> messageName.equals(v.getMessageName())); }
/** * Verifies that the actual MessageSubscriptionRecordValue's correlationKey is equal to the given one. * @param correlationKey the given correlationKey to compare the actual MessageSubscriptionRecordValue's correlationKey to. * @return this assertion object. * @throws AssertionError - if the actual MessageSubscriptionRecordValue's correlationKey is not equal to the given one. */ public S hasCorrelationKey(String correlationKey) { // check that actual MessageSubscriptionRecordValue we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one String assertjErrorMessage = "\nExpecting correlationKey of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // null safe check String actualCorrelationKey = actual.getCorrelationKey(); if (!Objects.areEqual(actualCorrelationKey, correlationKey)) { failWithMessage(assertjErrorMessage, actual, correlationKey, actualCorrelationKey); } // return the current assertion for method chaining return myself; }
/** * Verifies that the actual MessageSubscriptionRecordValue's elementInstanceKey is equal to the given one. * @param elementInstanceKey the given elementInstanceKey to compare the actual MessageSubscriptionRecordValue's elementInstanceKey to. * @return this assertion object. * @throws AssertionError - if the actual MessageSubscriptionRecordValue's elementInstanceKey is not equal to the given one. */ public S hasElementInstanceKey(long elementInstanceKey) { // check that actual MessageSubscriptionRecordValue we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one String assertjErrorMessage = "\nExpecting elementInstanceKey of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // check long actualElementInstanceKey = actual.getElementInstanceKey(); if (actualElementInstanceKey != elementInstanceKey) { failWithMessage(assertjErrorMessage, actual, elementInstanceKey, actualElementInstanceKey); } // return the current assertion for method chaining return myself; }
/** * Verifies that the actual MessageSubscriptionRecordValue's messageName is equal to the given one. * @param messageName the given messageName to compare the actual MessageSubscriptionRecordValue's messageName to. * @return this assertion object. * @throws AssertionError - if the actual MessageSubscriptionRecordValue's messageName is not equal to the given one. */ public S hasMessageName(String messageName) { // check that actual MessageSubscriptionRecordValue we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one String assertjErrorMessage = "\nExpecting messageName of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // null safe check String actualMessageName = actual.getMessageName(); if (!Objects.areEqual(actualMessageName, messageName)) { failWithMessage(assertjErrorMessage, actual, messageName, actualMessageName); } // return the current assertion for method chaining return myself; }
@Test public void shouldOpenMessageSubscriptionsOnDifferentPartitions() { // when IntStream.range(0, 10) .forEach( i -> { testClient.createWorkflowInstance( PROCESS_ID, asMsgPack("key", CORRELATION_KEY_PARTITION_0)); testClient.createWorkflowInstance( PROCESS_ID, asMsgPack("key", CORRELATION_KEY_PARTITION_1)); testClient.createWorkflowInstance( PROCESS_ID, asMsgPack("key", CORRELATION_KEY_PARTITION_2)); }); // then assertThat( RecordingExporter.messageSubscriptionRecords(MessageSubscriptionIntent.OPENED) .limit(30)) .extracting(r -> tuple(r.getMetadata().getPartitionId(), r.getValue().getCorrelationKey())) .containsOnly( tuple(0, CORRELATION_KEY_PARTITION_0), tuple(1, CORRELATION_KEY_PARTITION_1), tuple(2, CORRELATION_KEY_PARTITION_2)); }
@Test public void shouldOpenMessageSubscriptionsOnDifferentPartitions() { // when IntStream.range(0, 10) .forEach( i -> { testClient.createWorkflowInstance( PROCESS_ID, asMsgPack("key", CORRELATION_KEY_PARTITION_0)); testClient.createWorkflowInstance( PROCESS_ID, asMsgPack("key", CORRELATION_KEY_PARTITION_1)); testClient.createWorkflowInstance( PROCESS_ID, asMsgPack("key", CORRELATION_KEY_PARTITION_2)); }); // then assertThat( RecordingExporter.messageSubscriptionRecords(MessageSubscriptionIntent.OPENED) .limit(30)) .extracting(r -> tuple(r.getMetadata().getPartitionId(), r.getValue().getCorrelationKey())) .containsOnly( tuple(0, CORRELATION_KEY_PARTITION_0), tuple(1, CORRELATION_KEY_PARTITION_1), tuple(2, CORRELATION_KEY_PARTITION_2)); }