Deployment cache is not clean


#1

Hi,

I have added some changes in the camunda engine source code to handle additional form field types. To test this change I have modified BpmnDeploymentTest.java to add the following function:

public void testDeployment() {

  	String bpmnResourceName = "org/camunda/bpm/engine/test/bpmn/deployment/BpmnDeploymentTest.testMultiLine2.bpmn20.xml";
    repositoryService.createDeployment().enableDuplicateFiltering().addClasspathResource(bpmnResourceName).name("testingdepw").deploy();

    String deploymentId = repositoryService.createDeploymentQuery().singleResult().getId();

}
But when I run this as a Junit test I get an error “java.lang.AssertionError: Deployment cache is not clean:”

I have attached the stack trace.

trace.txt (1.5 KB)

Could you tell me why this happens?


#2

Hi @deepti deepti,

The tests offer an annotation to deploy a process model (see https://docs.camunda.org/manual/7.7/user-guide/testing/#deploy-test-resources). It’s hidden in the text and there should be an example, to show that @Deployment(resources = {"myProcess1.bpmn", "mySubProcess2.bpmn"}) is possible much more convenient to test your processes.

The annotation deletes the process models from the database when the test is completed.

If this didn’t lead to clean database, your error occurs.

If you wan’t to test the deployment explicitly, you have to undeploy the process definition in your test to get the green bar.

Hope this helps, Ingo