Program: 114911
Project: 114911
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str" + "String_Node_Str") public void testInvokingWithAPIGoldTierApplicationGoldResourceUnlimited() throws Exception {
  apiStoreClientUser1.addApplication(APPLICATION_NAME,APIMIntegrationConstants.APPLICATION_TIER.LARGE,"String_Node_Str","String_Node_Str");
  APIIdentifier apiIdentifier=new APIIdentifier(providerName,API_NAME,API_VERSION_1_0_0);
  apiIdentifier.setTier(TIER_GOLD);
  createPublishAndSubscribeToAPI(apiIdentifier,apiCreationRequestBean,apiPublisherClientUser1,apiStoreClientUser1,APPLICATION_NAME);
  waitForAPIDeploymentSync(apiIdentifier.getProviderName(),API_NAME,apiIdentifier.getVersion(),APIMIntegrationConstants.IS_API_EXISTS);
  String accessToken=generateApplicationKeys(apiStoreClientUser1,APPLICATION_NAME).getAccessToken();
  requestHeaders=new HashMap<String,String>();
  requestHeaders.put("String_Node_Str","String_Node_Str");
  requestHeaders.put("String_Node_Str","String_Node_Str" + accessToken);
  long startTime=System.currentTimeMillis();
  long currentTime;
  for (int invocationCount=1; invocationCount <= GOLD_INVOCATION_LIMIT_PER_MIN; invocationCount++) {
    currentTime=System.currentTimeMillis();
    HttpResponse invokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0) + "String_Node_Str" + API_END_POINT_METHOD,requestHeaders);
    assertEquals(invokeResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str" + invocationCount + "String_Node_Str"+ (currentTime - startTime)+ "String_Node_Str"+ "String_Node_Str");
    assertTrue(invokeResponse.getData().contains(API_RESPONSE_DATA),"String_Node_Str" + invocationCount + "String_Node_Str"+ (currentTime - startTime)+ "String_Node_Str"+ "String_Node_Str");
  }
  HttpResponse invokeResponse;
  currentTime=System.currentTimeMillis();
  invokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0) + "String_Node_Str" + API_END_POINT_METHOD,requestHeaders);
  if (executionMode.equalsIgnoreCase(String.valueOf(ExecutionEnvironment.PLATFORM))) {
    while (true) {
      invokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0) + "String_Node_Str" + API_END_POINT_METHOD,requestHeaders);
      System.out.println("String_Node_Str" + invokeResponse.getResponseCode());
      if (invokeResponse.getResponseCode() == HTTP_RESPONSE_CODE_TOO_MANY_REQUESTS) {
        break;
      }
    }
  }
  assertEquals(invokeResponse.getResponseCode(),HTTP_RESPONSE_CODE_TOO_MANY_REQUESTS,"String_Node_Str" + (GOLD_INVOCATION_LIMIT_PER_MIN + 1) + "String_Node_Str"+ (currentTime - startTime)+ "String_Node_Str"+ "String_Node_Str");
  assertTrue(invokeResponse.getData().contains(MESSAGE_THROTTLED_OUT),"String_Node_Str" + (GOLD_INVOCATION_LIMIT_PER_MIN + 1) + "String_Node_Str"+ (currentTime - startTime)+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str" + "String_Node_Str") public void testInvokingWithAPIGoldTierApplicationGoldResourceUnlimited() throws Exception {
  apiStoreClientUser1.addApplication(APPLICATION_NAME,APIMIntegrationConstants.APPLICATION_TIER.UNLIMITED,"String_Node_Str","String_Node_Str");
  APIIdentifier apiIdentifier=new APIIdentifier(providerName,API_NAME,API_VERSION_1_0_0);
  apiIdentifier.setTier(TIER_GOLD);
  createPublishAndSubscribeToAPI(apiIdentifier,apiCreationRequestBean,apiPublisherClientUser1,apiStoreClientUser1,APPLICATION_NAME);
  waitForAPIDeploymentSync(apiIdentifier.getProviderName(),API_NAME,apiIdentifier.getVersion(),APIMIntegrationConstants.IS_API_EXISTS);
  String accessToken=generateApplicationKeys(apiStoreClientUser1,APPLICATION_NAME).getAccessToken();
  requestHeaders=new HashMap<String,String>();
  requestHeaders.put("String_Node_Str","String_Node_Str");
  requestHeaders.put("String_Node_Str","String_Node_Str" + accessToken);
  long startTime=System.currentTimeMillis();
  long currentTime;
  for (int invocationCount=1; invocationCount <= GOLD_INVOCATION_LIMIT_PER_MIN; invocationCount++) {
    currentTime=System.currentTimeMillis();
    HttpResponse invokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0) + "String_Node_Str" + API_END_POINT_METHOD,requestHeaders);
    assertEquals(invokeResponse.getResponseCode(),HTTP_RESPONSE_CODE_OK,"String_Node_Str" + invocationCount + "String_Node_Str"+ (currentTime - startTime)+ "String_Node_Str"+ "String_Node_Str");
    assertTrue(invokeResponse.getData().contains(API_RESPONSE_DATA),"String_Node_Str" + invocationCount + "String_Node_Str"+ (currentTime - startTime)+ "String_Node_Str"+ "String_Node_Str");
  }
  HttpResponse invokeResponse;
  currentTime=System.currentTimeMillis();
  invokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0) + "String_Node_Str" + API_END_POINT_METHOD,requestHeaders);
  if (executionMode.equalsIgnoreCase(String.valueOf(ExecutionEnvironment.PLATFORM))) {
    while (true) {
      invokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(API_CONTEXT,API_VERSION_1_0_0) + "String_Node_Str" + API_END_POINT_METHOD,requestHeaders);
      System.out.println("String_Node_Str" + invokeResponse.getResponseCode());
      if (invokeResponse.getResponseCode() == HTTP_RESPONSE_CODE_TOO_MANY_REQUESTS) {
        break;
      }
    }
  }
  assertEquals(invokeResponse.getResponseCode(),HTTP_RESPONSE_CODE_TOO_MANY_REQUESTS,"String_Node_Str" + (GOLD_INVOCATION_LIMIT_PER_MIN + 1) + "String_Node_Str"+ (currentTime - startTime)+ "String_Node_Str"+ "String_Node_Str");
  assertTrue(invokeResponse.getData().contains(MESSAGE_THROTTLED_OUT),"String_Node_Str" + (GOLD_INVOCATION_LIMIT_PER_MIN + 1) + "String_Node_Str"+ (currentTime - startTime)+ "String_Node_Str"+ "String_Node_Str");
}