Activiti CDI / Weld SE / CDI unit

283 Views Asked by At

Has anyone ever tried to test Activiti / BPMN processes using pure CDI? In theory (if I didn't miss anything) I would think it should be possible to use f.ex. cdi-unit for testing processes together with activiti-engine and activiti-cdi. CDI unit internally uses weld-se.

But I couldn't make it work, I think the reason is that Activiti CDI and CDI unit work on different contexts, and I haven't found out how to "join" them (or maybe it's not possible).

Using @Inject on a ProcessEngine in a test annotated with @RunWith(CdiRunner.class) (as in the CDI unit quickstart) didn't "trigger" anything - i.e. Activiti or the ProcessEngine weren't touched.

1

There are 1 best solutions below

2
Petr Mensik On

I would suggest you to use Arquillian which is already mature project that will help you to run your tests inside CDI container. There are also plenty of extensions and one of them is camunda which can help you with testing BPMN processes so maybe you should take look at it :)