I was wondering if it is possible to load process definitions in the test classpath or if the auto-loading mechanism will automatically will pick up the resources from a path in the test path?
Currently trying to create a deployment by configuring the process engine bean in a test configuration class results in an error:
@Bean
public RepositoryService repositoryService(ProcessEngine processEngine) {
// Load bpmn from the test classes
processEngine.getRepositoryService().createDeployment().addClasspathResource("src/test/resources/processes/test-process.bpmn20.xml");
return processEngine.getRepositoryService();
}
The preferred method is to use @Deployment and either name the test process appropriately or use a resource argument to specify the process under test.
Here are the docs
Some notes,
the class loader usually puts the contents of the resources folder
you need execute .deploy() to get the process deployed to the engine
If you are using Spring Boot then the auto loading mechanism for production is the same for the tests.
By default Spring Boot configured Engine would try to load all process definitions from the processes/ directory (both from the test and production paths).
For specific tests of course the answer from @wwitt stands