camunda/camunda-bpm-assert

[CMMN] isCompleted does not work on completed executions

stefanzilske opened this issue · 1 comments

When I want to assert, that an Execution, let's say a human task, is completed using the CMMN assertions like this

assertThat(caseInstance).humanTask("task").isCompleted()

I am getting an Exception, that says Expecting actual not to be null.

I assume that isCompleted tries to look up the execution in the runtime database, but it should instead look into the history database, since completed executions are removed from runtime tables.

Hi Stefan,

actually the .humanTask("task") call is looking for a human task in the runtime data, not the .isCompleted().
Please note that you could do something like

// Given
...
HumanTaskAssert humanTask = assertThat(caseInstance).humanTask("task");
// When
complete(caseExecution("task", caseInstance));
// Then
humanTask.isCompleted();

which just works fine.

Regarding the lookup of the task in the history data:
We consider this a useful extension, but we will not work on CMMN features any time soon.
We encourage you to make a code contribution by submitting a pull request.
Thank you for your understanding.

Best,
Tobias