I have a SpringBoot Camunda process application which runs in a shared tomcat environment.
I would like to run scenario tests which spin up an in-memory process engine to test the entire process path, and to do this I’ve been using
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(properties = {"camunda.bpm.process-engine-name=default"})
@ContextConfiguration(classes =MyCamundaSpringApplicationContext.class)
public class MyScenarioTest {
@Autowired
private ProcessEngine processEngine;
@Rule
@ClassRule
public static ProcessEngineRule processEngineRule;
public ProcessInstance processInstance;
@PostConstruct
void initRule() {
processEngineRule = TestCoverageProcessEngineRuleBuilder
.create(processEngine)
.withDetailedCoverageLogging()
.build();
}
With my application class being defined as:
@SpringBootApplication
@EnableProcessApplication
public class MySpringBootApplication {
public static void main(String[] args) {
SpringApplication.run(MySpringBootApplication.class);
}
}
This requires me to have Camunda spring starter as a provided dependency. I’d prefer to use my application as:
@SpringBootApplication
public class MySpringBootApplication extends SpringServletProcessApplication {
public static void main(String[] args) {
SpringApplication.run(MySpringBootApplication.class);
}
}
but when I run my scenario tests the process engine is null.