I am trying to extend test case for camunda and JUnit5. I am getting the following error - Illegal call of execute(job = 'null') - must not be null! java.lang.IllegalArgumentException: Illegal call of execute(job = 'null') - must not be null!
@ExtendWith(ProcessEngineExtension.class)
public class SimpleTestCase {
@Deployment(resources = {"testProcess.bpmn"})
@Test
public void shouldExecuteProcess() {
// Given we create a new process instance
ProcessInstance processInstance = runtimeService().startProcessInstanceByKey("testProcess");
// Then it should be active
assertThat(processInstance).isActive();
// And it should be the only instance
assertThat(processInstanceQuery().count()).isEqualTo(1);
// And there should exist just a single task within that process instance
assertThat(task(processInstance)).isNotNull();
ProcessEngineTests.execute(ProcessEngineTests.job());
BpmnAwareTests.execute(BpmnAwareTests.job());
// When we complete that task
complete(task(processInstance));
// Then the process instance should be ended
assertThat(processInstance).isEnded();
//then
//Checking the run queue
assertThat(processInstance).hasPassedInOrder(new String[] { "UserTask_1","UserTask_2"});
}