How to change the name of deployed resources in Spring Boot test

When testing with Camunda Spring Boot application, the process application resources (BPMN model, DMN model and so on) will be automatically deployed and the name of them seems be their full path, e.g. <workspace>/src/resources/model/xxxx.bpmn. The problem is the path will be changed when the test is running on the other environment rather than the development environment.

May I know whether the it can be defined programmingly please?

At present, I find two solutions for the question as follows:

  1. Use a 3-rd party library to define the name the resources. However, it only supports Java >= 17 currently.

  2. Disable the auto deployment mechanism with camunda.bpm.auto-deployment-enabled=false, and then deploy resources programmingly before test, e.g.:

@BeforeEach
void deployResources() {
    repositoryService().createDeployment()
            .addInputStream("<name of recource 1>", <InputStream of resource 1>)
            .addInputStream("<name of recource 2>", <InputStream of resource 2>)
            .deploy();
}