camunda/camunda-bpm-assert

provide less confusing message for "getExistingCurrent"

jangalinski opened this issue · 1 comments

A colleague working with the assertions in our new project just came to me because he was confused by an assertion error message.

He was using "assertThat(processInstance).isWaitingAt("foo")", but accidentally modelled a "Task" instead of a "UserTask". So the execution had not wait state and the test failed.
So far so good. But, the message he got was:

   "Expecting assertion to be called on non-null current state of actual %s, "but found it to be null!"

This happens because of the "A getExistingCurrent()" method called before the isWaitingAt assertion.

I believe, a simple "the process instance already ended" would be clearer here, helping to find the real bug - wrong task type.

Many thx for reporting this!