@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)); }