Program: 114876
Project: 114876
Buggy source:
@Test(description="String_Node_Str") public void generateApplicationKeyWithoutScope() throws Exception {
  apiCreationRequestBean=new APICreationRequestBean(apiName,context,version,apiProvider,new URL(endpointUrl));
  apiCreationRequestBean.setEndpointType(endPointType);
  apiCreationRequestBean.setTiersCollection(tier);
  apiCreationRequestBean.setTags(tags);
  apiCreationRequestBean.setResourceBeanList(resourceBeanList);
  apiCreationRequestBean.setDescription(apiDescription);
  apiCreationRequestBean.setVisibility(visibility);
  log.info(apiCreationRequestBean);
  HttpResponse apiCreateResponse=apiPublisher.addAPI(apiCreationRequestBean);
  assertEquals(apiCreateResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject createApiJsonObject=new JSONObject(apiCreateResponse.getData());
  assertEquals(createApiJsonObject.getBoolean("String_Node_Str"),false,"String_Node_Str");
  HttpResponse verifyApiResponse=apiPublisher.getApi(apiName,apiProvider,version);
  JSONObject verifyApiJsonObject=new JSONObject(verifyApiResponse.getData());
  assertFalse(verifyApiJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(apiName,apiProvider,APILifeCycleState.PUBLISHED);
  HttpResponse statusUpdateResponse=apiPublisher.changeAPILifeCycleStatus(updateRequest);
  assertEquals(statusUpdateResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject statusUpdateJsonObject=new JSONObject(statusUpdateResponse.getData());
  assertFalse(statusUpdateJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
  apiProvider=storeContext.getContextTenant().getContextUser().getUserName();
  HttpResponse addApplicationResponse=apiStore.addApplication(applicationName,appTier,callbackUrl,applicationDescription);
  assertEquals(addApplicationResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str" + applicationName);
  JSONObject addApplicationJsonObject=new JSONObject(addApplicationResponse.getData());
  assertFalse(addApplicationJsonObject.getBoolean("String_Node_Str"),"String_Node_Str" + applicationName);
  SubscriptionRequest apiSubscriptionRequest=new SubscriptionRequest(apiName,version,apiProvider,applicationName,tier);
  HttpResponse subscriptionResponse=apiStore.subscribe(apiSubscriptionRequest);
  assertEquals(subscriptionResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject subscriptionResponseJsonObject=new JSONObject(subscriptionResponse.getData());
  assertFalse(subscriptionResponseJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
  APPKeyRequestGenerator appKeyRequestGenerator=new APPKeyRequestGenerator(applicationName);
  String responseString=apiStore.generateApplicationKey(appKeyRequestGenerator).getData();
  JSONObject jsonObject=new JSONObject(responseString);
  String accessToken=jsonObject.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").getString("String_Node_Str");
  Map<String,String> applicationHeader=new HashMap<String,String>();
  applicationHeader.put("String_Node_Str","String_Node_Str" + accessToken);
  applicationHeader.put("String_Node_Str","String_Node_Str");
  waitForAPIDeploymentSync(apiCreationRequestBean.getProvider(),apiCreationRequestBean.getName(),"String_Node_Str",APIMIntegrationConstants.IS_API_EXISTS);
  HttpResponse apiInvokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp("String_Node_Str","String_Node_Str") + "String_Node_Str",applicationHeader);
  String apiResponse="String_Node_Str";
  assertEquals(apiInvokeResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  assertTrue(apiInvokeResponse.getData().contains(apiResponse),"String_Node_Str");
}

Fixed version (ground truth):
@Test(description="String_Node_Str") public void generateApplicationKeyWithoutScope() throws Exception {
  apiCreationRequestBean=new APICreationRequestBean(apiName,context,version,apiProvider,new URL(endpointUrl));
  apiCreationRequestBean.setEndpointType(endPointType);
  apiCreationRequestBean.setTiersCollection(tier);
  apiCreationRequestBean.setTags(tags);
  apiCreationRequestBean.setResourceBeanList(resourceBeanList);
  apiCreationRequestBean.setDescription(apiDescription);
  apiCreationRequestBean.setVisibility(visibility);
  log.info(apiCreationRequestBean);
  HttpResponse apiCreateResponse=apiPublisher.addAPI(apiCreationRequestBean);
  assertEquals(apiCreateResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject createApiJsonObject=new JSONObject(apiCreateResponse.getData());
  assertEquals(createApiJsonObject.getBoolean("String_Node_Str"),false,"String_Node_Str");
  HttpResponse verifyApiResponse=apiPublisher.getApi(apiName,apiProvider,version);
  JSONObject verifyApiJsonObject=new JSONObject(verifyApiResponse.getData());
  assertFalse(verifyApiJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(apiName,apiProvider,APILifeCycleState.PUBLISHED);
  HttpResponse statusUpdateResponse=apiPublisher.changeAPILifeCycleStatus(updateRequest);
  assertEquals(statusUpdateResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject statusUpdateJsonObject=new JSONObject(statusUpdateResponse.getData());
  assertFalse(statusUpdateJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
  waitForAPIDeploymentSync(apiCreationRequestBean.getProvider(),apiCreationRequestBean.getName(),"String_Node_Str",APIMIntegrationConstants.IS_API_EXISTS);
  apiProvider=storeContext.getContextTenant().getContextUser().getUserName();
  HttpResponse addApplicationResponse=apiStore.addApplication(applicationName,appTier,callbackUrl,applicationDescription);
  assertEquals(addApplicationResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str" + applicationName);
  JSONObject addApplicationJsonObject=new JSONObject(addApplicationResponse.getData());
  assertFalse(addApplicationJsonObject.getBoolean("String_Node_Str"),"String_Node_Str" + applicationName);
  SubscriptionRequest apiSubscriptionRequest=new SubscriptionRequest(apiName,version,apiProvider,applicationName,tier);
  HttpResponse subscriptionResponse=apiStore.subscribe(apiSubscriptionRequest);
  assertEquals(subscriptionResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject subscriptionResponseJsonObject=new JSONObject(subscriptionResponse.getData());
  assertFalse(subscriptionResponseJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
  APPKeyRequestGenerator appKeyRequestGenerator=new APPKeyRequestGenerator(applicationName);
  String responseString=apiStore.generateApplicationKey(appKeyRequestGenerator).getData();
  JSONObject jsonObject=new JSONObject(responseString);
  String accessToken=jsonObject.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").getString("String_Node_Str");
  Map<String,String> applicationHeader=new HashMap<String,String>();
  applicationHeader.put("String_Node_Str","String_Node_Str" + accessToken);
  applicationHeader.put("String_Node_Str","String_Node_Str");
  HttpResponse apiInvokeResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp("String_Node_Str","String_Node_Str") + "String_Node_Str",applicationHeader);
  String apiResponse="String_Node_Str";
  assertEquals(apiInvokeResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  assertTrue(apiInvokeResponse.getData().contains(apiResponse),"String_Node_Str");
}