"NullValueException" when running Unit test?


I am running the following unit test:

  public class ProcessTest {

    private ProcessEngineConfiguration processEngineConfiguration;
    private ProcessEngine processEngine;

    public void setUp() {
       this.processEngineConfiguration = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
       this.processEngine = processEngineConfiguration.buildProcessEngine();

    @Deployment (resources = "test.bpmn")
    public void shouldStartProcess() {
       ProcessInstance processInstance = processEngine.getRuntimeService().startProcessInstanceByKey("test");

I have the file test.bpmn under the resources folder.

  <bpmn2:process id="test" isExecutable="true"> // I assume that process id is the process instance key??

When I run the test I get the following exception:

  org.camunda.bpm.engine.exception.NullValueException: no processes deployed with key 'test': processDefinition is null.

The process is somehow not deployed can someone tell me what am I doing wrong here?

Thank you

Best regards,

I have fixed the problem using ProcessEngineRule instead of the Process Engine initialization I had before.

I had to add the file camunda.cfg.xml under resources as well.