How to stop the history data cleanup on unit test?

I am using the persistence database (MySQL) for my unit test. I would like to keep the history data when the unit test is completed.

I am using the rule to run the engine. I have configured StandaloneProcessEngineConfiguration on camunda.cfg.xml.

When I have breakpoints in unit test, I can see the records in database tables (including history). As soon as the unit test is completed, the data is deleted from history tables.

I would like to keep the history data. Please advise the configuration for this.

@Rule
public ProcessEngineRule processEngineRule = new ProcessEngineRule(false);

Hi,

do you use the deployment annotation for your unit test?

Greets
Chris

Yes, I am using @Deployment annotation with process name.

@Deployment(resources={“processname.bpmn”})

Looks like it is clearing the history and run time tables. In one test case, the test didn’t complete all the tasks in the process. Still I couldn’t see the records in runtime tables.

Hi,

I think the problem is the Deployment annotation in combination with the ProcessEngineRule.
Take a look in the implementation then you see that the rule cleans the database after running an test. For that it removes the deployments which are registered via the Deployment annotation. So a solution might be to simply deploy the deployment via the RepositoryService manually.

Greets
Chris