public DeploymentRecordStream withResource(final DeploymentResource resource) { return valueFilter(v -> v.getResources().contains(resource)); }
public DeploymentRecordStream withResources(final List<DeploymentResource> resources) { return valueFilter(v -> resources.equals(v.getResources())); }
/** * 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 withResources(final List<DeploymentResource> resources) { return valueFilter(v -> resources.equals(v.getResources())); }
public DeploymentRecordStream withResource(final DeploymentResource resource) { return valueFilter(v -> v.getResources().contains(resource)); }
/** * 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; }
/** * 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 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; }
/** * Verifies that the actual DeploymentRecordValue's resources does not contain the given io.zeebe.exporter.record.value.deployment.DeploymentResource elements. * * @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(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 varargs is not null. if (resources == null) failWithMessage("Expecting resources parameter not to be null."); // check with standard error message (use overridingErrorMessage before contains to set your own message). Iterables.instance().assertDoesNotContain(info, actual.getResources(), resources); // return the current assertion for method chaining return myself; }
/** * Verifies that the actual DeploymentRecordValue's resources contains the given io.zeebe.exporter.record.value.deployment.DeploymentResource elements. * @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(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 varargs is not null. if (resources == null) failWithMessage("Expecting resources 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.getResources(), resources); // return the current assertion for method chaining return myself; }
/** * Verifies that the actual DeploymentRecordValue's resources contains <b>only</b> the given io.zeebe.exporter.record.value.deployment.DeploymentResource elements 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(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 varargs is not null. if (resources == null) failWithMessage("Expecting resources 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.getResources(), resources); // 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"); }
(deploymentCreatedEvent) -> { final DeploymentRecordValue deployment = deploymentCreatedEvent.getValue(); final DeploymentResource resource = deployment.getResources().get(0); Assertions.assertThat(resource).hasResourceType(ResourceType.YAML_WORKFLOW);
(deploymentCreatedEvent) -> { final DeploymentRecordValue deployment = deploymentCreatedEvent.getValue(); final DeploymentResource resource = deployment.getResources().get(0); Assertions.assertThat(resource).hasResourceType(ResourceType.YAML_WORKFLOW);