public DeploymentRecordStream withDeployedWorkflow(final DeployedWorkflow deployedWorkflow) { return valueFilter(v -> v.getDeployedWorkflows().contains(deployedWorkflow)); } }
public DeploymentRecordStream withDeployedWorkflows( final List<DeployedWorkflow> deployedWorkflows) { return valueFilter(v -> deployedWorkflows.equals(v.getDeployedWorkflows())); }
public DeploymentRecordStream withDeployedWorkflow(final DeployedWorkflow deployedWorkflow) { return valueFilter(v -> v.getDeployedWorkflows().contains(deployedWorkflow)); } }
public DeploymentRecordStream withDeployedWorkflows( final List<DeployedWorkflow> deployedWorkflows) { return valueFilter(v -> deployedWorkflows.equals(v.getDeployedWorkflows())); }
/** * Verifies that the actual DeploymentRecordValue has no deployedWorkflows. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's deployedWorkflows is not empty. */ public S hasNoDeployedWorkflows() { // check that actual DeploymentRecordValue we want to make assertions on is not null. isNotNull(); // we override the default error message with a more explicit one String assertjErrorMessage = "\nExpecting :\n <%s>\nnot to have deployedWorkflows but had :\n <%s>"; // check if (actual.getDeployedWorkflows().iterator().hasNext()) { failWithMessage(assertjErrorMessage, actual, actual.getDeployedWorkflows()); } // return the current assertion for method chaining return myself; }
@SuppressWarnings("unchecked") private DeployedWorkflow getDeployedWorkflow( final Record<DeploymentRecordValue> record, final int offset) { return record.getValue().getDeployedWorkflows().get(offset); }
@SuppressWarnings("unchecked") private DeployedWorkflow getDeployedWorkflow( final Record<DeploymentRecordValue> record, final int offset) { return record.getValue().getDeployedWorkflows().get(offset); }
/** * Verifies that the actual DeploymentRecordValue's deployedWorkflows contains <b>only</b> the given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements in Collection and nothing else in whatever order. * @param deployedWorkflows the given elements that should be contained in actual DeploymentRecordValue's deployedWorkflows. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's deployedWorkflows does not contain all given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements. */ public S hasOnlyDeployedWorkflows(java.util.Collection<? extends io.zeebe.exporter.record.value.deployment.DeployedWorkflow> deployedWorkflows) { // check that actual DeploymentRecordValue we want to make assertions on is not null. isNotNull(); // check that given io.zeebe.exporter.record.value.deployment.DeployedWorkflow collection is not null. if (deployedWorkflows == null) { failWithMessage("Expecting deployedWorkflows parameter not to be null."); return myself; // to fool Eclipse "Null pointer access" warning on toArray. } // check with standard error message, to set another message call: info.overridingErrorMessage("my error message"); Iterables.instance().assertContainsOnly(info, actual.getDeployedWorkflows(), deployedWorkflows.toArray()); // return the current assertion for method chaining return myself; }
/** * Verifies that the actual DeploymentRecordValue's deployedWorkflows does not contain the given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements in Collection. * * @param deployedWorkflows the given elements that should not be in actual DeploymentRecordValue's deployedWorkflows. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's deployedWorkflows contains any given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements. */ public S doesNotHaveDeployedWorkflows(java.util.Collection<? extends io.zeebe.exporter.record.value.deployment.DeployedWorkflow> deployedWorkflows) { // check that actual DeploymentRecordValue we want to make assertions on is not null. isNotNull(); // check that given io.zeebe.exporter.record.value.deployment.DeployedWorkflow collection is not null. if (deployedWorkflows == null) { failWithMessage("Expecting deployedWorkflows parameter not to be null."); return myself; // to fool Eclipse "Null pointer access" warning on toArray. } // check with standard error message (use overridingErrorMessage before contains to set your own message). Iterables.instance().assertDoesNotContain(info, actual.getDeployedWorkflows(), deployedWorkflows.toArray()); // return the current assertion for method chaining return myself; }
/** * Verifies that the actual DeploymentRecordValue's deployedWorkflows contains the given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements in Collection. * @param deployedWorkflows the given elements that should be contained in actual DeploymentRecordValue's deployedWorkflows. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's deployedWorkflows does not contain all given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements. */ public S hasDeployedWorkflows(java.util.Collection<? extends io.zeebe.exporter.record.value.deployment.DeployedWorkflow> deployedWorkflows) { // check that actual DeploymentRecordValue we want to make assertions on is not null. isNotNull(); // check that given io.zeebe.exporter.record.value.deployment.DeployedWorkflow collection is not null. if (deployedWorkflows == null) { failWithMessage("Expecting deployedWorkflows parameter not to be null."); return myself; // to fool Eclipse "Null pointer access" warning on toArray. } // check with standard error message, to set another message call: info.overridingErrorMessage("my error message"); Iterables.instance().assertContains(info, actual.getDeployedWorkflows(), deployedWorkflows.toArray()); // return the current assertion for method chaining return myself; }
/** * Verifies that the actual DeploymentRecordValue's deployedWorkflows contains the given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements. * @param deployedWorkflows the given elements that should be contained in actual DeploymentRecordValue's deployedWorkflows. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's deployedWorkflows does not contain all given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements. */ public S hasDeployedWorkflows(io.zeebe.exporter.record.value.deployment.DeployedWorkflow... deployedWorkflows) { // check that actual DeploymentRecordValue we want to make assertions on is not null. isNotNull(); // check that given io.zeebe.exporter.record.value.deployment.DeployedWorkflow varargs is not null. if (deployedWorkflows == null) failWithMessage("Expecting deployedWorkflows parameter not to be null."); // check with standard error message, to set another message call: info.overridingErrorMessage("my error message"); Iterables.instance().assertContains(info, actual.getDeployedWorkflows(), deployedWorkflows); // return the current assertion for method chaining return myself; }
/** * Verifies that the actual DeploymentRecordValue's deployedWorkflows does not contain the given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements. * * @param deployedWorkflows the given elements that should not be in actual DeploymentRecordValue's deployedWorkflows. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's deployedWorkflows contains any given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements. */ public S doesNotHaveDeployedWorkflows(io.zeebe.exporter.record.value.deployment.DeployedWorkflow... deployedWorkflows) { // check that actual DeploymentRecordValue we want to make assertions on is not null. isNotNull(); // check that given io.zeebe.exporter.record.value.deployment.DeployedWorkflow varargs is not null. if (deployedWorkflows == null) failWithMessage("Expecting deployedWorkflows parameter not to be null."); // check with standard error message (use overridingErrorMessage before contains to set your own message). Iterables.instance().assertDoesNotContain(info, actual.getDeployedWorkflows(), deployedWorkflows); // return the current assertion for method chaining return myself; }
/** * Verifies that the actual DeploymentRecordValue's deployedWorkflows contains <b>only</b> the given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements and nothing else in whatever order. * @param deployedWorkflows the given elements that should be contained in actual DeploymentRecordValue's deployedWorkflows. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's deployedWorkflows does not contain all given io.zeebe.exporter.record.value.deployment.DeployedWorkflow elements. */ public S hasOnlyDeployedWorkflows(io.zeebe.exporter.record.value.deployment.DeployedWorkflow... deployedWorkflows) { // check that actual DeploymentRecordValue we want to make assertions on is not null. isNotNull(); // check that given io.zeebe.exporter.record.value.deployment.DeployedWorkflow varargs is not null. if (deployedWorkflows == null) failWithMessage("Expecting deployedWorkflows parameter not to be null."); // check with standard error message, to set another message call: info.overridingErrorMessage("my error message"); Iterables.instance().assertContainsOnly(info, actual.getDeployedWorkflows(), deployedWorkflows); // return the current assertion for method chaining return myself; }
private void assertDeploymentRecord(final Record<DeploymentRecordValue> deploymentCreatedEvent) { final DeploymentResource resource = deploymentCreatedEvent.getValue().getResources().get(0); Assertions.assertThat(resource) .hasResource(bpmnXml(WORKFLOW)) .hasResourceType(ResourceType.BPMN_XML); final List<DeployedWorkflow> deployedWorkflows = deploymentCreatedEvent.getValue().getDeployedWorkflows(); assertThat(deployedWorkflows).hasSize(1); Assertions.assertThat(deployedWorkflows.get(0)) .hasBpmnProcessId("process") .hasVersion(1) .hasWorkflowKey(1) .hasResourceName("process.bpmn"); }
private void assertDeploymentRecord(final Record<DeploymentRecordValue> deploymentCreatedEvent) { final DeploymentResource resource = deploymentCreatedEvent.getValue().getResources().get(0); Assertions.assertThat(resource) .hasResource(bpmnXml(WORKFLOW)) .hasResourceType(ResourceType.BPMN_XML); final List<DeployedWorkflow> deployedWorkflows = deploymentCreatedEvent.getValue().getDeployedWorkflows(); assertThat(deployedWorkflows).hasSize(1); Assertions.assertThat(deployedWorkflows.get(0)) .hasBpmnProcessId("process") .hasVersion(1) .hasWorkflowKey(1) .hasResourceName("process.bpmn"); }
Assertions.assertThat(resource).hasResourceType(ResourceType.YAML_WORKFLOW); final List<DeployedWorkflow> deployedWorkflows = deployment.getDeployedWorkflows(); assertThat(deployedWorkflows).hasSize(1);
Assertions.assertThat(resource).hasResourceType(ResourceType.YAML_WORKFLOW); final List<DeployedWorkflow> deployedWorkflows = deployment.getDeployedWorkflows(); assertThat(deployedWorkflows).hasSize(1);
@Test public void shouldCompleteWorkflow() { // when final ExecuteCommandResponse response = testClient.deployWithResponse(SIMPLE_MODEL); final DeploymentRecordValue deploymentRecord = testClient .receiveFirstDeploymentEvent(DeploymentIntent.CREATED, response.getKey()) .getValue(); // then assertThat(RecordingExporter.timerRecords(TimerIntent.CREATED).exists()).isTrue(); brokerRule.getClock().addTime(Duration.ofSeconds(1)); final WorkflowInstanceRecordValue instanceCompleted = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED) .getFirst() .getValue(); Assertions.assertThat(instanceCompleted) .hasBpmnProcessId("process") .hasVersion(1) .hasWorkflowKey(deploymentRecord.getDeployedWorkflows().get(0).getWorkflowKey()); }
@Test public void shouldCompleteWorkflow() { // when final ExecuteCommandResponse response = testClient.deployWithResponse(SIMPLE_MODEL); final DeploymentRecordValue deploymentRecord = testClient .receiveFirstDeploymentEvent(DeploymentIntent.CREATED, response.getKey()) .getValue(); // then assertThat(RecordingExporter.timerRecords(TimerIntent.CREATED).exists()).isTrue(); brokerRule.getClock().addTime(Duration.ofSeconds(1)); final WorkflowInstanceRecordValue instanceCompleted = RecordingExporter.workflowInstanceRecords(WorkflowInstanceIntent.ELEMENT_COMPLETED) .getFirst() .getValue(); Assertions.assertThat(instanceCompleted) .hasBpmnProcessId("process") .hasVersion(1) .hasWorkflowKey(deploymentRecord.getDeployedWorkflows().get(0).getWorkflowKey()); }
.receiveFirstDeploymentEvent(DeploymentIntent.CREATED, response.getKey()) .getValue() .getDeployedWorkflows() .get(0);