public WorkflowInstanceAssert hasCompleted(String... elementIds) { final List<String> ids = Arrays.asList(elementIds); final List<String> completedElements = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED) .withWorkflowInstanceKey(workflowInstanceKey) .filter(elementId(ids)) .map(r -> r.getValue().getElementId()) .limit(ids.size()) .collect(Collectors.toList()); if (completedElements.size() < ids.size()) { final List<String> notCompleted = new ArrayList<>(ids); notCompleted.removeAll(completedElements); failWithMessage("Expected <%s> to be completed but could not find <%s>", ids, notCompleted); } return this; }
public WorkflowInstanceAssert hasEntered(String... elementIds) { final List<String> ids = Arrays.asList(elementIds); final List<String> enteredElements = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_ACTIVATED) .withWorkflowInstanceKey(workflowInstanceKey) .filter(elementId(ids)) .map(r -> r.getValue().getElementId()) .limit(ids.size()) .collect(Collectors.toList()); if (enteredElements.size() < ids.size()) { final List<String> notEntered = new ArrayList<>(ids); notEntered.removeAll(enteredElements); failWithMessage("Expected <%s> to be entered but could not find <%s>", ids, notEntered); } return this; }
public WorkflowInstanceAssert hasCompleted(String... elementIds) { final List<String> ids = Arrays.asList(elementIds); final List<String> completedElements = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED) .withWorkflowInstanceKey(workflowInstanceKey) .filter(elementId(ids)) .map(r -> r.getValue().getElementId()) .limit(ids.size()) .collect(Collectors.toList()); if (completedElements.size() < ids.size()) { final List<String> notCompleted = new ArrayList<>(ids); notCompleted.removeAll(completedElements); failWithMessage("Expected <%s> to be completed but could not find <%s>", ids, notCompleted); } return this; }
public WorkflowInstanceAssert hasEntered(String... elementIds) { final List<String> ids = Arrays.asList(elementIds); final List<String> enteredElements = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_ACTIVATED) .withWorkflowInstanceKey(workflowInstanceKey) .filter(elementId(ids)) .map(r -> r.getValue().getElementId()) .limit(ids.size()) .collect(Collectors.toList()); if (enteredElements.size() < ids.size()) { final List<String> notEntered = new ArrayList<>(ids); notEntered.removeAll(enteredElements); failWithMessage("Expected <%s> to be entered but could not find <%s>", ids, notEntered); } return this; }
public WorkflowInstanceAssert hasPassed(String... elementIds) { final List<String> ids = Arrays.asList(elementIds); final List<String> passedElements = RecordingExporter.workflowInstanceRecords() .withWorkflowInstanceKey(workflowInstanceKey) .filter(intent(ELEMENT_PASSED_INTENTS)) .filter(elementId(ids)) .map(r -> r.getValue().getElementId()) .limit(ids.size()) .collect(Collectors.toList()); if (passedElements.size() < ids.size()) { final List<String> notPassed = new ArrayList<>(ids); notPassed.removeAll(passedElements); failWithMessage("Expected <%s> to be passed but could not find <%s>", ids, notPassed); } return this; }
public WorkflowInstanceAssert hasPassed(String... elementIds) { final List<String> ids = Arrays.asList(elementIds); final List<String> passedElements = RecordingExporter.workflowInstanceRecords() .withWorkflowInstanceKey(workflowInstanceKey) .filter(intent(ELEMENT_PASSED_INTENTS)) .filter(elementId(ids)) .map(r -> r.getValue().getElementId()) .limit(ids.size()) .collect(Collectors.toList()); if (passedElements.size() < ids.size()) { final List<String> notPassed = new ArrayList<>(ids); notPassed.removeAll(passedElements); failWithMessage("Expected <%s> to be passed but could not find <%s>", ids, notPassed); } return this; }
.withWorkflowInstanceKey(workflowInstance1) .limit(3) .map(s -> s.getValue().getElementId()) .collect(Collectors.toList()); assertThat(takenSequenceFlows).contains("s1").doesNotContain("s2"); .withWorkflowInstanceKey(workflowInstance2) .limit(3) .map(s -> s.getValue().getElementId()) .collect(Collectors.toList()); assertThat(takenSequenceFlows).contains("s2").doesNotContain("s1");
.withWorkflowInstanceKey(workflowInstance1) .limit(3) .map(s -> s.getValue().getElementId()) .collect(Collectors.toList()); assertThat(takenSequenceFlows).contains("s1").doesNotContain("s2"); .withWorkflowInstanceKey(workflowInstance2) .limit(3) .map(s -> s.getValue().getElementId()) .collect(Collectors.toList()); assertThat(takenSequenceFlows).contains("s2").doesNotContain("s1");