Program: 114779
Project: 114779
Buggy source:
@Test(groups="String_Node_Str",description="String_Node_Str") public void testHttpPatchSupport() throws Exception {
  apiPublisher.login(user.getUserName(),user.getPassword());
  String APIName="String_Node_Str";
  String APIContext="String_Node_Str";
  String url=getGatewayURLNhttp() + "String_Node_Str";
  String providerName=user.getUserName();
  String APIVersion="String_Node_Str";
  APIRequest apiRequest=new APIRequest(APIName,APIContext,new URL(url));
  apiRequest.setVersion(APIVersion);
  apiRequest.setProvider(providerName);
  apiPublisher.addAPI(apiRequest);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(APIName,providerName,APILifeCycleState.PUBLISHED);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
  waitForAPIDeploymentSync(providerName,APIName,APIVersion,APIMIntegrationConstants.IS_API_EXISTS);
  String modifiedResource="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  apiPublisher.updateResourceOfAPI(providerName,APIName,APIVersion,modifiedResource);
  waitForAPIDeployment();
  apiStore.login(user.getUserName(),user.getPassword());
  apiStore.addApplication("String_Node_Str",APIMIntegrationConstants.APPLICATION_TIER.DEFAULT_APP_POLICY_FIFTY_REQ_PER_MIN,"String_Node_Str","String_Node_Str");
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(APIName,APIVersion,providerName,"String_Node_Str",APIMIntegrationConstants.API_TIER.GOLD);
  apiStore.subscribe(subscriptionRequest);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator("String_Node_Str");
  String responseString=apiStore.generateApplicationKey(generateAppKeyRequest).getData();
  JSONObject jsonResponse=new JSONObject(responseString);
  String accessToken=jsonResponse.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").getString("String_Node_Str");
  String apiInvocationUrl=getAPIInvocationURLHttp(APIContext,APIVersion);
  HttpClient client=HttpClientBuilder.create().build();
  HttpPatch request=new HttpPatch(apiInvocationUrl);
  request.setHeader("String_Node_Str","String_Node_Str");
  request.setHeader("String_Node_Str","String_Node_Str" + accessToken);
  StringEntity payload=new StringEntity("String_Node_Str","String_Node_Str");
  payload.setContentType("String_Node_Str");
  request.setEntity(payload);
  HttpResponse httpResponsePatch=client.execute(request);
  assertEquals(httpResponsePatch.getStatusLine().getStatusCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups="String_Node_Str",description="String_Node_Str") public void testHttpPatchSupport() throws Exception {
  apiPublisher.login(user.getUserName(),user.getPassword());
  String APIName="String_Node_Str";
  String APIContext="String_Node_Str";
  String url=getGatewayURLNhttp() + "String_Node_Str";
  String providerName=user.getUserName();
  String APIVersion="String_Node_Str";
  APIRequest apiRequest=new APIRequest(APIName,APIContext,new URL(url));
  apiRequest.setVersion(APIVersion);
  apiRequest.setProvider(providerName);
  apiRequest.setResourceMethod("String_Node_Str");
  apiPublisher.addAPI(apiRequest);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(APIName,providerName,APILifeCycleState.PUBLISHED);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
  waitForAPIDeploymentSync(providerName,APIName,APIVersion,APIMIntegrationConstants.IS_API_EXISTS);
  apiStore.login(user.getUserName(),user.getPassword());
  apiStore.addApplication("String_Node_Str",APIMIntegrationConstants.APPLICATION_TIER.DEFAULT_APP_POLICY_FIFTY_REQ_PER_MIN,"String_Node_Str","String_Node_Str");
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(APIName,APIVersion,providerName,"String_Node_Str",APIMIntegrationConstants.API_TIER.GOLD);
  apiStore.subscribe(subscriptionRequest);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator("String_Node_Str");
  String responseString=apiStore.generateApplicationKey(generateAppKeyRequest).getData();
  JSONObject jsonResponse=new JSONObject(responseString);
  String accessToken=jsonResponse.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").getString("String_Node_Str");
  String apiInvocationUrl=getAPIInvocationURLHttp(APIContext,APIVersion);
  HttpClient client=HttpClientBuilder.create().build();
  HttpPatch request=new HttpPatch(apiInvocationUrl);
  request.setHeader("String_Node_Str","String_Node_Str");
  request.setHeader("String_Node_Str","String_Node_Str" + accessToken);
  StringEntity payload=new StringEntity("String_Node_Str","String_Node_Str");
  payload.setContentType("String_Node_Str");
  request.setEntity(payload);
  HttpResponse httpResponsePatch=client.execute(request);
  assertEquals(httpResponsePatch.getStatusLine().getStatusCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
}