To get started with process tests I’m trying to replicate the (Camunda platform 7) example found here: Testing process definitions | Camunda Platform 8 Docs.
But what every I try I keep ending up with org.camunda.bpm.engine.exception.NullValueException: no processes deployed with key 'HelloWorldProcess': processDefinition is null
(or any other process id I’ve defined) error. My process tests looks like this:
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.assertThat;
import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.runtimeService;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.engine.test.Deployment;
import org.camunda.bpm.engine.test.junit5.ProcessEngineExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
@ExtendWith({ProcessEngineExtension.class, MockitoExtension.class})
public class HelloWorldProcessTests {
@Test
@Deployment(resources = {"bpmn/hello-world.bpmn"})
void helloWorld() {
ProcessInstance processInstance = runtimeService()
.startProcessInstanceByKey("HelloWorldProcess");
assertThat(processInstance).isActive();
}
}
The only thing that I can get to run is when I copy the testProcess.bpmn file from the example found here https://github.com/camunda/camunda-engine-unittest/blob/master/src/test/resources/testProcess.bpmn
I’ve tried various versions of the Camunda modeller 4 and 5, different versions of Camunda, locations of the bpmn files, naming conventions of the files and process id’s, different camunda.cfg.xml files etc. But nothing seems to work.
The only thing that I noticed is that the testProcess.bpmn
file uses different tags. The testProcess.bpmn
file uses bpmn2
tags in while all the other bpmn files I generate using the modeler uses the bpmn
tag.
Anybody knows how I can get the process test to work on bpmn models I make using the Camunda modeler 4 or 5?
update: the difference in tags does not seem to be the issues. I’ve changed the tags in the testProcess to bpmn and it still works. Visa versa, I’ve changed the tags in my hello-world process to bpmn2 and it still does not work.
Its just strange, that I can deploy all my process models when I run the application. But that they somehow don’t get deployed when testing while no errors are shown in the logs?