Program: 114890
Project: 114890
Buggy source:
/** 
 * This method can be used to wait for API Un-deployment sync in distributed and clustered environment APIStatusMonitor will be invoked to get API related data and then verify that data matches with expected response provided.
 * @param apiProvider      - Provider of the API
 * @param apiName          - API name
 * @param apiVersion       - API version
 * @param expectedResponse - Expected response
 * @throws XPathExpressionException - Throws if something goes wrong
 */
protected void waitForAPIUnDeploymentSync(String apiProvider,String apiName,String apiVersion,String expectedResponse) throws IOException, XPathExpressionException {
  long currentTime=System.currentTimeMillis();
  long waitTime=currentTime + WAIT_TIME;
  if (executionMode.equalsIgnoreCase(String.valueOf(ExecutionEnvironment.PLATFORM))) {
    while (waitTime > System.currentTimeMillis()) {
      HttpResponse response=HttpRequestUtil.sendGetRequest(getGatewayURLHttp() + "String_Node_Str" + apiProvider+ "String_Node_Str"+ apiName+ "String_Node_Str"+ apiVersion,null);
      log.info("String_Node_Str" + apiName + "String_Node_Str"+ apiVersion+ "String_Node_Str"+ apiProvider+ "String_Node_Str"+ expectedResponse);
      if (!response.getData().contains(expectedResponse)) {
        log.info("String_Node_Str" + apiName + "String_Node_Str"+ apiVersion+ "String_Node_Str"+ expectedResponse+ "String_Node_Str");
        break;
      }
 else {
        try {
          Thread.sleep(500);
        }
 catch (        InterruptedException ignored) {
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This method can be used to wait for API Un-deployment sync in distributed and clustered environment APIStatusMonitor will be invoked to get API related data and then verify that data matches with expected response provided.
 * @param apiProvider      - Provider of the API
 * @param apiName          - API name
 * @param apiVersion       - API version
 * @param expectedResponse - Expected response
 * @throws APIManagerIntegrationTestException - Throws if something goes wrong
 */
protected void waitForAPIUnDeploymentSync(String apiProvider,String apiName,String apiVersion,String expectedResponse) throws APIManagerIntegrationTestException {
  long currentTime=System.currentTimeMillis();
  long waitTime=currentTime + WAIT_TIME;
  if (executionMode.equalsIgnoreCase(String.valueOf(ExecutionEnvironment.PLATFORM))) {
    String tenantIdentifier=getTenantIdentifier(apiProvider);
    while (waitTime > System.currentTimeMillis()) {
      HttpResponse response=null;
      try {
        response=HttpRequestUtil.sendGetRequest(getGatewayURLHttp() + "String_Node_Str" + tenantIdentifier+ apiName+ "String_Node_Str"+ apiVersion,null);
      }
 catch (      IOException ignored) {
        log.warn("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + apiName + "String_Node_Str"+ "String_Node_Str"+ apiProvider);
      }
      log.info("String_Node_Str" + apiName + "String_Node_Str"+ apiVersion+ "String_Node_Str"+ apiProvider+ "String_Node_Str"+ expectedResponse);
      if (response != null) {
        if (!response.getData().contains(expectedResponse)) {
          log.info("String_Node_Str" + apiName + "String_Node_Str"+ apiVersion+ "String_Node_Str"+ expectedResponse+ "String_Node_Str");
          break;
        }
 else {
          try {
            Thread.sleep(500);
          }
 catch (          InterruptedException ignored) {
          }
        }
      }
    }
  }
}