Buggy code:
public class DeployUnDeployBPMNPackageTestCase extends BPSMasterTest { private static final Log log = LogFactory . getLog ( DeployUnDeployBPMNPackageTestCase . class ) ; @ Test ( groups = { "wso2.bps.test.deploy" } , description = "Deploy//UnDeploy<seq2seq4repair_space>Package<seq2seq4repair_space>Test" , priority = 1 , singleThreaded = true ) 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 = new String [ ] { } ; String [ ] deploymentCheckResponse = new String [ ] { } ; String deploymentStatus = "" ; try { deploymentResponse = tester . deployBPMNPackage ( filePath , fileName ) ; Assert . assertTrue ( "Deployment<seq2seq4repair_space>Successful" , deploymentResponse [ 0 ] . contains ( CREATED ) ) ; } catch ( Exception exception ) { DeployUnDeployBPMNPackageTestCase . log . error ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>Deploy<seq2seq4repair_space>BPMN<seq2seq4repair_space>Package<seq2seq4repair_space>" + fileName ) , exception ) ; Assert . fail ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>Deploy<seq2seq4repair_space>BPMN<seq2seq4repair_space>Package<seq2seq4repair_space>" + fileName ) ) ; } try { deploymentCheckResponse = tester . getDeploymentInfoById ( deploymentResponse [ 1 ] ) ; Assert . assertTrue ( "Deployment<seq2seq4repair_space>Present" , deploymentCheckResponse [ 2 ] . contains ( fileName ) ) ; } catch ( Exception exception ) { DeployUnDeployBPMNPackageTestCase . log . error ( ( ( "Deployed<seq2seq4repair_space>BPMN<seq2seq4repair_space>Package<seq2seq4repair_space>" + fileName ) + "<seq2seq4repair_space>Not<seq2seq4repair_space>Present" ) , exception ) ; Assert . fail ( ( ( "Deployed<seq2seq4repair_space>BPMN<seq2seq4repair_space>Package<seq2seq4repair_space>" + fileName ) + "<seq2seq4repair_space>Not<seq2seq4repair_space>Present" ) ) ; } try { deploymentStatus = tester . unDeployBPMNPackage ( deploymentResponse [ 1 ] ) ; Assert . assertTrue ( "Package<seq2seq4repair_space>UnDeployed" , deploymentStatus . contains ( NO_CONTENT ) ) ; } catch ( Exception exception ) { DeployUnDeployBPMNPackageTestCase . log . error ( ( "BPMN<seq2seq4repair_space>Package<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>undeployed<seq2seq4repair_space>" + fileName ) , exception ) ; Assert . fail ( ( "BPMN<seq2seq4repair_space>Package<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>undeployed<seq2seq4repair_space>" + fileName ) ) ; } try { String [ ] unDeployCheck = tester . getDeploymentInfoById ( deploymentResponse [ 1 ] ) ; <START_BUG> Assert . fail ( "Package<seq2seq4repair_space>Not<seq2seq4repair_space>Present" ) ; <END_BUG> } catch ( Exception exception ) { Assert . assertTrue ( ( ( "BPMN<seq2seq4repair_space>Package<seq2seq4repair_space>" + fileName ) + "<seq2seq4repair_space>Does<seq2seq4repair_space>Not<seq2seq4repair_space>Exist" ) , NOT_AVAILABLE . equals ( exception . getMessage ( ) ) ) ; DeployUnDeployBPMNPackageTestCase . log . error ( ( ( "BPMN<seq2seq4repair_space>Package<seq2seq4repair_space>" + fileName ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist" ) , exception ) ; } } No newline ; at end ; of file ; }

Fix:
Assert . fail ( "Package<seq2seq4repair_space>Still<seq2seq4repair_space>Exists<seq2seq4repair_space>After<seq2seq4repair_space>Undeployment" ) ;