This little community-extension to camunda BPM wants to make it easier to write tests for BPMN process definitions executed with the camunda process engine. For that reason, a set of assertions based on Joel Costigliola's AssertJ rich assertions library for java are provided, as well as a few little helpers to make it a bit easier to drive you through your process.
Hopefully this will also make it easier to change your tests half a year after you have written them yourself!-) In short: more readable code - less spaghetti tests!
- Getting started
- Resources, Maintainer and License
- Also check out the User Guide for a more detailed documentation.
First, declare the camunda BPM maven repository - if you haven't yet done so. Then you find here the coordinates for including camunda-bpm-assert in Apache Maven Projects:
<dependency>
<groupId>org.camunda.bpm.extension</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
Create your test case just as described in camunda BPM Testing. Then you just have to add the following static import:
import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*;
Now you have access to all the assertions provided by the AssertJ library - plus the customised camunda BPM assertions provided by this library. Let's assume you want to assert that your process instance
- was actually started
- is waiting at a specific user task and
- the task is yet unassigned, but waiting to be assigned to a user of a specific group:
Then write:
assertThat(processInstance).isStarted()
.task().hasDefinitionKey("edit")
.hasCandidateGroup("SB-Personal")
.isNotAssigned();
Green bar?
Congrats! You are successfully using camunda-bpm-assert. Find a more detailed description of the assertions and helper methods available in the camunda-bpm-assert User Guide.
## Resources- User Guide
- API Docs
- Issue Tracker
- Roadmap
- Download
- Continuous Integration
- Questions at camunda BPM users list
- Feedback at camunda BPM dev list
- Want to contribute? You are very welcome! Please contact me directly via eMail.
Martin Schimak - eMail - GitHub - Blog
## LicenseApache License, Version 2.0