Datasets:
Download source_data/pinned/camunda-dmn-examples/commit-ee4826e5e76c/test-utils/assert/README.md from Vinyeh/AutoOntologyBench: direct link, hf CLI and curl.
- Browser
- Download file 4.33 kB
-
https://huggingface.co/datasets/Vinyeh/AutoOntologyBench/resolve/main/source_data/pinned/camunda-dmn-examples/commit-ee4826e5e76c/test-utils/assert/README.md
- Command line
-
hf download hf://datasets/Vinyeh/AutoOntologyBench/source_data/pinned/camunda-dmn-examples/commit-ee4826e5e76c/test-utils/assert/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Vinyeh/AutoOntologyBench/resolve/main/source_data/pinned/camunda-dmn-examples/commit-ee4826e5e76c/test-utils/assert/README.md
Camunda Platform Assert
Camunda Platform Assert makes it easy to assert the status of your BPMN processes and CMMN cases when driving them forward in your typical unit test methods. Simply write code like
assertThat(instance).isWaitingAt("UserTask_InformCustomer");
assertThat(task).hasCandidateGroup("Sales").isNotAssigned();
Furthermore a set of static helper methods is provided to make it easier to drive through a process. Based on the 80/20 principle the library reaches out to make those things simple you need really often. You will e.g. often have a single open task instance in your process instance. Then just write
complete(task(instance), withVariables("approved", true));
Compatibility
Camunda Platform Assert works with the corresponding version of Camunda Platform (i.e., Camunda Platform Assert 7.17.0 is compatible to Camunda Platform 7.17.0). The compatibility between earlier versions are as shown in the documentation. Camunda Platform Assert works with multiple Java versions (1.8+). All of this is continuously verified by executing around 500 test cases.
Get started
- Add a maven test dependency to your project:
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<version>${camunda.platform.version}</version>
<scope>test</scope>
</dependency>
Additionally, AssertJ needs to be provided as a dependency with a version that is compatible with the one documented in the compatibility matrix.
Please note that if you use Spring Boot or the Camunda Spring Boot Starter in your project, AssertJ is already included in your project's setup.
- Add a static import to your test class
Create your test case just as described in the Camunda Platform Testing Guide and add Camunda Platform Assert by statically importing it in your test class:
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
- Start using the assertions in your test methods
You now have access to all the Camunda Platform assertions. Assuming you want to assert that your process instance is actually started, waiting at a specific user task and that task should yet be unassigned, but waiting to be assigned to a user of a specific group, just write:
assertThat(processInstance).isStarted()
.task().hasDefinitionKey("edit")
.hasCandidateGroup("human-resources")
.isNotAssigned();
In case you want to combine Camunda Platform Assert with the assertions provided by AssertJ, your imports should look like this:
import static org.assertj.core.api.Assertions.*;
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
Credits
The Camunda Platform Assert project used to be the community extension, created and supported by
Martin Schimak (plexiti GmbH)

Jan Galinski (Holisticon AG)
Martin Günther (Holisticon AG)
Malte Sörensen (Holisticon AG)
Simon Zambrovski (Holisticon AG)
... and many others.
In 2014, the library won the Camunda Platform Community Award.
Starting from version 3.0.0 it was adopted as part of the Camunda Platform. Starting from version 7.17.0 it was merged into the Camunda Platform main repository.