public void waitForPartition(final int partitions) { waitUntil(() -> getPartitionIds().size() >= partitions); }
protected void waitForAvailableEvent(final BufferedLogStreamReader logStreamReader) { TestUtil.waitUntil(() -> logStreamReader.hasNext()); } }
protected void waitForAvailableEvent(final BufferedLogStreamReader logStreamReader) { TestUtil.waitUntil(() -> logStreamReader.hasNext()); } }
/** * Blocks and wait until the workflow identified by the key has been completed. * * @param workflowInstanceKey ID of the workflow */ public void awaitWorkflowCompletion(long workflowInstanceKey) { TestUtil.waitUntil( () -> workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED) .filter(r -> r.getKey() == workflowInstanceKey) .exists()); }
/** * Blocks and wait until the workflow identified by the key has been completed. * * @param workflowInstanceKey ID of the workflow */ public void awaitWorkflowCompletion(long workflowInstanceKey) { TestUtil.waitUntil( () -> workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED) .filter(r -> r.getKey() == workflowInstanceKey) .exists()); }
private void awaitFirstRecordInState(final Intent state) { waitUntil(() -> environmentRule.events().withIntent(state).findFirst().isPresent()); }
private void awaitFirstRecordInState(final Intent state) { waitUntil(() -> environmentRule.events().withIntent(state).findFirst().isPresent()); }
public TypedRecord<TimerRecord> awaitTimerInState(final String timerId, final TimerIntent state) { final DirectBuffer handlerNodeId = wrapString(timerId); final Supplier<TypedRecordStream<TimerRecord>> lookupStream = () -> environmentRule .events() .onlyTimerRecords() .filter(r -> r.getValue().getHandlerNodeId().equals(handlerNodeId)) .withIntent(state); waitUntil(() -> lookupStream.get().findFirst().isPresent()); return lookupStream.get().findFirst().get(); }
public TypedRecord<TimerRecord> awaitTimerInState(final String timerId, final TimerIntent state) { final DirectBuffer handlerNodeId = wrapString(timerId); final Supplier<TypedRecordStream<TimerRecord>> lookupStream = () -> environmentRule .events() .onlyTimerRecords() .filter(r -> r.getValue().getHandlerNodeId().equals(handlerNodeId)) .withIntent(state); waitUntil(() -> lookupStream.get().findFirst().isPresent()); return lookupStream.get().findFirst().get(); }
public void awaitIncidentRejection(Intent state) { waitUntil( () -> environmentRule .events() .onlyIncidentRecords() .onlyRejections() .withIntent(state) .findFirst() .isPresent()); } }
public void awaitIncidentInState(Intent state) { waitUntil( () -> environmentRule .events() .onlyIncidentRecords() .onlyEvents() .withIntent(state) .findFirst() .isPresent()); }
public void awaitIncidentRejection(Intent state) { waitUntil( () -> environmentRule .events() .onlyIncidentRecords() .onlyRejections() .withIntent(state) .findFirst() .isPresent()); } }
public void awaitIncidentInState(Intent state) { waitUntil( () -> environmentRule .events() .onlyIncidentRecords() .onlyEvents() .withIntent(state) .findFirst() .isPresent()); }
public TypedRecord<JobRecord> awaitJobInState(final String activityId, final JobIntent state) { final DirectBuffer activityIdBuffer = wrapString(activityId); final Supplier<TypedRecordStream<JobRecord>> lookupStream = () -> environmentRule .events() .onlyJobRecords() .filter(r -> r.getValue().getHeaders().getElementId().equals(activityIdBuffer)) .withIntent(state); waitUntil(() -> lookupStream.get().findFirst().isPresent()); return lookupStream.get().findFirst().get(); } }
public TypedRecord<JobRecord> awaitJobInState(final String activityId, final JobIntent state) { final DirectBuffer activityIdBuffer = wrapString(activityId); final Supplier<TypedRecordStream<JobRecord>> lookupStream = () -> environmentRule .events() .onlyJobRecords() .filter(r -> r.getValue().getHeaders().getElementId().equals(activityIdBuffer)) .withIntent(state); waitUntil(() -> lookupStream.get().findFirst().isPresent()); return lookupStream.get().findFirst().get(); } }
private TypedRecord<TimerRecord> findTimerCommandRejection() { waitUntil(() -> envRule.events().onlyTimerRecords().onlyRejections().findFirst().isPresent()); return envRule.events().onlyTimerRecords().onlyRejections().findFirst().get(); } }
private TypedRecord<MessageSubscriptionRecord> awaitAndGetFirstSubscriptionRejection() { waitUntil( () -> rule.events() .onlyMessageSubscriptionRecords() .onlyRejections() .findFirst() .isPresent()); return rule.events().onlyMessageSubscriptionRecords().onlyRejections().findFirst().get(); } }
private TypedRecord<MessageSubscriptionRecord> awaitAndGetFirstSubscriptionRejection() { waitUntil( () -> rule.events() .onlyMessageSubscriptionRecords() .onlyRejections() .findFirst() .isPresent()); return rule.events().onlyMessageSubscriptionRecords().onlyRejections().findFirst().get(); } }
private TypedRecord<TimerRecord> findTimerCommandRejection() { waitUntil(() -> envRule.events().onlyTimerRecords().onlyRejections().findFirst().isPresent()); return envRule.events().onlyTimerRecords().onlyRejections().findFirst().get(); } }
@Before public void setUp() { streamProcessor = streamProcessorRule.getStreamProcessor(); // given streamProcessorRule.deploy( Bpmn.createExecutableProcess(PROCESS_ID) .startEvent() .intermediateCatchEvent("timer", c -> c.timerWithDuration("PT10S")) .endEvent() .done()); streamProcessor.blockAfterTimerEvent(r -> r.getMetadata().getIntent() == TimerIntent.CREATED); streamProcessorRule.createWorkflowInstance(PROCESS_ID); waitUntil(() -> streamProcessor.isBlocked()); }