public WorkflowInstanceRecordStream withBpmnProcessId(final String bpmnProcessId) { return valueFilter(v -> bpmnProcessId.equals(v.getBpmnProcessId())); }
public WorkflowInstanceRecordStream withBpmnProcessId(final String bpmnProcessId) { return valueFilter(v -> bpmnProcessId.equals(v.getBpmnProcessId())); }
/** * Verifies that the actual WorkflowInstanceRecordValue's bpmnProcessId is equal to the given one. * @param bpmnProcessId the given bpmnProcessId to compare the actual WorkflowInstanceRecordValue's bpmnProcessId to. * @return this assertion object. * @throws AssertionError - if the actual WorkflowInstanceRecordValue's bpmnProcessId is not equal to the given one. */ public S hasBpmnProcessId(String bpmnProcessId) { // check that actual WorkflowInstanceRecordValue we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one String assertjErrorMessage = "\nExpecting bpmnProcessId of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // null safe check String actualBpmnProcessId = actual.getBpmnProcessId(); if (!Objects.areEqual(actualBpmnProcessId, bpmnProcessId)) { failWithMessage(assertjErrorMessage, actual, bpmnProcessId, actualBpmnProcessId); } // return the current assertion for method chaining return myself; }
@Test public void shouldCreateWorkflowInstanceOfCollaboration() throws IOException { final InputStream resourceAsStream = getClass().getResourceAsStream("/workflows/collaboration.bpmn"); apiRule .partitionClient() .deployWithResponse( StreamUtil.read(resourceAsStream), ResourceType.BPMN_XML.name(), "collaboration.bpmn"); // when final long wfInstance1 = testClient.createWorkflowInstance("process1"); final long wfInstance2 = testClient.createWorkflowInstance("process2"); // then final Record<WorkflowInstanceRecordValue> event1 = testClient.receiveFirstWorkflowInstanceEvent( wfInstance1, WorkflowInstanceIntent.ELEMENT_READY); assertThat(event1.getValue().getBpmnProcessId()).isEqualTo("process1"); final Record<WorkflowInstanceRecordValue> event2 = testClient.receiveFirstWorkflowInstanceEvent( wfInstance2, WorkflowInstanceIntent.ELEMENT_READY); assertThat(event2.getValue().getBpmnProcessId()).isEqualTo("process2"); }
@Test public void shouldCreateWorkflowInstanceOfCollaboration() throws IOException { final InputStream resourceAsStream = getClass().getResourceAsStream("/workflows/collaboration.bpmn"); apiRule .partitionClient() .deployWithResponse( StreamUtil.read(resourceAsStream), ResourceType.BPMN_XML.name(), "collaboration.bpmn"); // when final long wfInstance1 = testClient.createWorkflowInstance("process1"); final long wfInstance2 = testClient.createWorkflowInstance("process2"); // then final Record<WorkflowInstanceRecordValue> event1 = testClient.receiveFirstWorkflowInstanceEvent( wfInstance1, WorkflowInstanceIntent.ELEMENT_ACTIVATING); assertThat(event1.getValue().getBpmnProcessId()).isEqualTo("process1"); final Record<WorkflowInstanceRecordValue> event2 = testClient.receiveFirstWorkflowInstanceEvent( wfInstance2, WorkflowInstanceIntent.ELEMENT_ACTIVATING); assertThat(event2.getValue().getBpmnProcessId()).isEqualTo("process2"); }