Camunda BPM Assert
Camunda BPM 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
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));
Camunda BPM Assert works with the versions of Camunda BPM as shown in the documentation and multiple Java versions (1.8+). This is continuously verified by executing around 500 test cases against a travis ci test matrix.
Get started in 3 simple steps!
1. Add a maven test dependency to your project:
<dependency> <groupId>org.camunda.bpm.assert</groupId> <artifactId>camunda-bpm-assert</artifactId> <version>8.0.0</version> <scope>test</scope> </dependency>
2. Add a static import to your test class
Create your test case just as described in the Camunda BPM Testing Guide and add Camunda BPM Assert by statically importing it in your test class:
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
3. Start using the assertions in your test methods
You now have access to all the Camunda BPM 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 BPM 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.*;
Find a more detailed description of the assertions and helper methods available in the Camunda BPM Assert User Guide.
The source files in this repository are made available under the Apache License, Version 2.0.
The Camunda BPM Assert project used to be the community extension, created and supported by
... and many others.
In 2014, the library won the Camunda BPM Community Award.
Starting from version 3.0.0 it was adopted as part of the Camunda BPM Platform.