【发布时间】:2022-01-24 11:55:57
【问题描述】:
我正在尝试扩展 camunda 和 JUnit5 的测试用例。 我收到以下错误 - 非法调用 execute(job = 'null') - 不能为空! java.lang.IllegalArgumentException: 非法调用 execute(job = '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"});
}
【问题讨论】:
标签: junit camunda camunda-modeler