Source:
public void deployUnDeployBPMNPackage() throws Exception { init(); ActivitiRestClient tester = new ActivitiRestClient(bpsServer.getInstance().getPorts().get("http"), bpsServer.getInstance().getHosts().get("default")); String filePath = FrameworkPathUtil.getSystemResourceLocation() + File.separator + BPMNTestConstants.DIR_ARTIFACTS + File.separator + BPMNTestConstants.DIR_BPMN + File.separator + "HelloApprove.bar"; String fileName = "HelloApprove.bar"; String[] deploymentResponse = {}; String[] deploymentCheckResponse = {}; String deploymentStatus = ""; try { deploymentResponse = tester.deployBPMNPackage(filePath, fileName); Assert.assertTrue("Deployment Successful", deploymentResponse[0].contains(BPMNTestConstants.CREATED)); } catch (Exception exception) { log.error("Failed to Deploy BPMN Package " + fileName, exception); Assert.fail("Failed to Deploy BPMN Package " + fileName); } try { deploymentCheckResponse = tester.getDeploymentInfoById(deploymentResponse[1]); Assert.assertTrue("Deployment Present", deploymentCheckResponse[2].contains(fileName)); } catch (Exception exception) { log.error("Deployed BPMN Package " + fileName + " Not Present", exception); Assert.fail("Deployed BPMN Package " + fileName + " Not Present"); } try { deploymentStatus = tester.unDeployBPMNPackage(deploymentResponse[1]); Assert.assertTrue("Package UnDeployed", deploymentStatus.contains(BPMNTestConstants.NO_CONTENT)); } catch (Exception exception) { log.error("BPMN Package cannot be undeployed " + fileName, exception); Assert.fail("BPMN Package cannot be undeployed " + fileName); } try { String[] unDeployCheck = tester.getDeploymentInfoById(deploymentResponse[1]); Assert.fail("Package Not Present"); } catch (Exception exception) { Assert.assertTrue("BPMN Package " + fileName + " Does Not Exist", BPMNTestConstants.NOT_AVAILABLE.equals(exception.getMessage())); log.error("BPMN Package " + fileName + " does not exist", exception); } }

Target:
public void deployUnDeployBPMNPackage() throws Exception { init(); ActivitiRestClient tester = new ActivitiRestClient(bpsServer.getInstance().getPorts().get("http"), bpsServer.getInstance().getHosts().get("default")); String filePath = FrameworkPathUtil.getSystemResourceLocation() + File.separator + BPMNTestConstants.DIR_ARTIFACTS + File.separator + BPMNTestConstants.DIR_BPMN + File.separator + "HelloApprove.bar"; String fileName = "HelloApprove.bar"; String[] deploymentResponse = {}; String[] deploymentCheckResponse = {}; String deploymentStatus = ""; try { deploymentResponse = tester.deployBPMNPackage(filePath, fileName); Assert.assertTrue("Deployment Successful", deploymentResponse[0].contains(BPMNTestConstants.CREATED)); } catch (Exception exception) { log.error("Failed to Deploy BPMN Package " + fileName, exception); Assert.fail("Failed to Deploy BPMN Package " + fileName); } try { deploymentCheckResponse = tester.getDeploymentInfoById(deploymentResponse[1]); Assert.assertTrue("Deployment Present", deploymentCheckResponse[2].contains(fileName)); } catch (Exception exception) { log.error("Deployed BPMN Package " + fileName + " Not Present", exception); Assert.fail("Deployed BPMN Package " + fileName + " Not Present"); } try { deploymentStatus = tester.unDeployBPMNPackage(deploymentResponse[1]); Assert.assertTrue("Package UnDeployed", deploymentStatus.contains(BPMNTestConstants.NO_CONTENT)); } catch (Exception exception) { log.error("BPMN Package cannot be undeployed " + fileName, exception); Assert.fail("BPMN Package cannot be undeployed " + fileName); } try { String[] unDeployCheck = tester.getDeploymentInfoById(deploymentResponse[1]); Assert.fail("Package Still Exists After Undeployment"); } catch (Exception exception) { Assert.assertTrue("BPMN Package " + fileName + " Does Not Exist", BPMNTestConstants.NOT_AVAILABLE.equals(exception.getMessage())); log.error("BPMN Package " + fileName + " does not exist", exception); } }