Is it possible to autoload process definitions in the test class path?

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
repositoryService.createDeployment().addClasspathResource("processes/test-process.bpmn20.xml").name("test-process").deploy();

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

I am using springboot and I added processes to my src/test/resources/processes however when I query for deployments:

List<Deployment> deploymentList = repositoryService.createDeploymentQuery().list();

I get a 0 count.

That should work indeed …
How are you configuring your test? Can you paste more of the full unit test so we can reproduce?