repositoryService.deleteDeployment(deploymentId, true, false);
assertTrue(TestExecutionListener.collectedEvents.size() == 1);
TestExecutionListener.reset();
deploymentId = deploymentBuilder.deploy().getId();
runtimeService.startProcessInstanceByKey("testProcess");
repositoryService.deleteDeployment(deploymentId, true, true);
assertTrue(TestExecutionListener.collectedEvents.size() == 0);