I would like to do unit testing for bpm processes and mock the delegats using mockito. I understand that this should (or can) be done with camunda-bpm-assert.
However, I'm missing any information about how to use it ;-(
Is there any example of a working setup? Is there already a pom in the repository?
Thanks and regards,
Jens Kanschik.
--You received this message because you are subscribed to the Google Groups "camunda BPM users" group.To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.To post to this group, send email to camunda-...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/8b459bf8-6f3e-406b-b1a9-67575640b542%40googlegroups.com.For more options, visit https://groups.google.com/groups/opt_out.
By now, I think my problems with unit testing are rather related to a problem with timer events and setting the current time in unit tests.
In general, I can test and mock delegates as described in your link. However, as soon as I add a timer event, I get strange errors.
Would you mind to check out the small demo project at https://github.com/jkanschik/camunda-timer-test ?
There are two tests: one is working, but without a timer event. The second is not working - there is a strange error that the expression cannot be resolved:
Unknown property used in expression: #{loggerDelegate.doSomething()}. Cause: Cannot resolve identifier 'loggerDelegate'
Since the service tasks and the setup in both processes is identical, the problem seems to be related to the timer.
Am I doing something wrong using "setCurrentTime()" or is there some bug?
Regards,
Jens.
Your two lines of code solved the problem, thanks a lot. I saw that Mocks.register() registers the mocks in a thread local variable (mockContainer), so your explanation makes sense. I just had no clue how to resolve the problem ;-)
I will push the fixed code to github.
Regards,
Jens.