public DeploymentRecordStream withDeployedWorkflow(final DeployedWorkflow deployedWorkflow) { return valueFilter(v -> v.getDeployedWorkflows().contains(deployedWorkflow)); } }
public DeploymentRecordStream withResource(final DeploymentResource resource) { return valueFilter(v -> v.getResources().contains(resource)); }
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"); }
public DeploymentRecordStream withDeployedWorkflows( final List<DeployedWorkflow> deployedWorkflows) { return valueFilter(v -> deployedWorkflows.equals(v.getDeployedWorkflows())); }
(deploymentCreatedEvent) -> { final DeploymentRecordValue deployment = deploymentCreatedEvent.getValue(); final DeploymentResource resource = deployment.getResources().get(0); Assertions.assertThat(resource).hasResourceType(ResourceType.YAML_WORKFLOW); final List<DeployedWorkflow> deployedWorkflows = deployment.getDeployedWorkflows(); assertThat(deployedWorkflows).hasSize(1);
public DeploymentRecordStream withResources(final List<DeploymentResource> resources) { return valueFilter(v -> resources.equals(v.getResources())); }
public DeploymentRecordStream withDeployedWorkflow(final DeployedWorkflow deployedWorkflow) { return valueFilter(v -> v.getDeployedWorkflows().contains(deployedWorkflow)); } }
(deploymentCreatedEvent) -> { final DeploymentRecordValue deployment = deploymentCreatedEvent.getValue(); final DeploymentResource resource = deployment.getResources().get(0); Assertions.assertThat(resource).hasResourceType(ResourceType.YAML_WORKFLOW); final List<DeployedWorkflow> deployedWorkflows = deployment.getDeployedWorkflows(); assertThat(deployedWorkflows).hasSize(1);
/** * Verifies that the actual DeploymentRecordValue has no resources. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's resources is not empty. */ public S hasNoResources() { // 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 resources but had :\n <%s>"; // check if (actual.getResources().iterator().hasNext()) { failWithMessage(assertjErrorMessage, actual, actual.getResources()); } // return the current assertion for method chaining return myself; }
public DeploymentRecordStream withDeployedWorkflows( final List<DeployedWorkflow> deployedWorkflows) { return valueFilter(v -> deployedWorkflows.equals(v.getDeployedWorkflows())); }
public DeploymentRecordStream withResources(final List<DeploymentResource> resources) { return valueFilter(v -> resources.equals(v.getResources())); }
/** * 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; }
public DeploymentRecordStream withResource(final DeploymentResource resource) { return valueFilter(v -> v.getResources().contains(resource)); }
@SuppressWarnings("unchecked") private DeployedWorkflow getDeployedWorkflow( final Record<DeploymentRecordValue> record, final int offset) { return record.getValue().getDeployedWorkflows().get(offset); }
/** * Verifies that the actual DeploymentRecordValue's resources contains the given io.zeebe.exporter.record.value.deployment.DeploymentResource elements in Collection. * @param resources the given elements that should be contained in actual DeploymentRecordValue's resources. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's resources does not contain all given io.zeebe.exporter.record.value.deployment.DeploymentResource elements. */ public S hasResources(java.util.Collection<? extends io.zeebe.exporter.record.value.deployment.DeploymentResource> resources) { // check that actual DeploymentRecordValue we want to make assertions on is not null. isNotNull(); // check that given io.zeebe.exporter.record.value.deployment.DeploymentResource collection is not null. if (resources == null) { failWithMessage("Expecting resources 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.getResources(), resources.toArray()); // 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); }
/** * Verifies that the actual DeploymentRecordValue's resources contains <b>only</b> the given io.zeebe.exporter.record.value.deployment.DeploymentResource elements in Collection and nothing else in whatever order. * @param resources the given elements that should be contained in actual DeploymentRecordValue's resources. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's resources does not contain all given io.zeebe.exporter.record.value.deployment.DeploymentResource elements. */ public S hasOnlyResources(java.util.Collection<? extends io.zeebe.exporter.record.value.deployment.DeploymentResource> resources) { // check that actual DeploymentRecordValue we want to make assertions on is not null. isNotNull(); // check that given io.zeebe.exporter.record.value.deployment.DeploymentResource collection is not null. if (resources == null) { failWithMessage("Expecting resources 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.getResources(), resources.toArray()); // 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 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 resources does not contain the given io.zeebe.exporter.record.value.deployment.DeploymentResource elements in Collection. * * @param resources the given elements that should not be in actual DeploymentRecordValue's resources. * @return this assertion object. * @throws AssertionError if the actual DeploymentRecordValue's resources contains any given io.zeebe.exporter.record.value.deployment.DeploymentResource elements. */ public S doesNotHaveResources(java.util.Collection<? extends io.zeebe.exporter.record.value.deployment.DeploymentResource> resources) { // check that actual DeploymentRecordValue we want to make assertions on is not null. isNotNull(); // check that given io.zeebe.exporter.record.value.deployment.DeploymentResource collection is not null. if (resources == null) { failWithMessage("Expecting resources 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.getResources(), resources.toArray()); // return the current assertion for method chaining return myself; }