Hello everyone,
I’m trying to mock process engine because I want to do some unit testing of camunda BPMNs.
Here is part of my code:
@RunWith(MockitoJUnitRunner.class)
public class ExampleUnitTest {
@Mock
public ProcessEngine processEngine;
@Test
public void regularTest()
{
RuntimeService runtimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(ProcessNameUtils.EXAMPLE);
assertThat(processInstance).isStarted();
}
}
I’m getting null pointer exception on getRuntimeService() method.
Does anyone know how to fix this issue?
Thank you in advance!