DEV Community

Cover image for Add initial testing to Camunda with Spring Boot 🍃
Thomas Gotwig
Thomas Gotwig

Posted on

Add initial testing to Camunda with Spring Boot 🍃

Let's add a test to our application so that we don't have to confirm things like the User Task manually! As well as some assertions to know what got executed and what not.

Here you can find the code for this chapter under the git tag chapter-2.

For doing the assertions we need:

Enter fullscreen mode Exit fullscreen mode

And there is our final happyPath test which goes through all we did from the last article automatically! 🤗

class MainDelegateTest {

    @Autowired private RuntimeService runtimeService;

    @Autowired private ManagementService managementService;

    ProcessInstance pi;

    public void beforeEach() {
        pi = runtimeService.startProcessInstanceByKey(

    public void happyPath() {

    private ProcessInstanceAssert completeTask() {
        return assertThat(pi);
Enter fullscreen mode Exit fullscreen mode

loanApproval is from loanApproval.bpmn which you can find inside the Camunda Modeler when nothing is selected 🖼️

complete(task()) are two static functions which are doing the clicking on Complete part from the last article for you 🤖

Top comments (0)