Program: 114906
Project: 114906
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testAPICreationTenant() throws Exception {
  apiStoreTenant=new APIStoreRestClient(storeURLHttp);
  apiStoreTenant.login(TENANT_WSO2_ADMIN,TENANT_WSO2_ADMIN_PASS);
  apiPublisherTenant=new APIPublisherRestClient(publisherURLHttp);
  apiPublisherTenant.login(TENANT_WSO2_ADMIN,TENANT_WSO2_ADMIN_PASS);
  apiRequestTenant=new APIRequest(apiName,APIContext,new URL(endpointUrl));
  apiRequestTenant.setTags(tags);
  apiRequestTenant.setDescription(description);
  apiRequestTenant.setVersion(APIVersion);
  apiRequestTenant.setProvider(TENANT_WSO2_ADMIN);
  HttpResponse serviceResponse=apiPublisherTenant.addAPI(apiRequestTenant);
  verifyResponse(serviceResponse);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(apiName,TENANT_WSO2_ADMIN,APILifeCycleState.PUBLISHED);
  serviceResponse=apiPublisherTenant.changeAPILifeCycleStatus(updateRequest);
  verifyResponse(serviceResponse);
  serviceResponse=apiStoreTenant.addApplication(appName,APIThrottlingTier.UNLIMITED.getState(),"String_Node_Str","String_Node_Str");
  verifyResponse(serviceResponse);
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(apiName,TENANT_WSO2_ADMIN);
  subscriptionRequest.setApplicationName(appName);
  subscriptionRequest.setTier(APIMIntegrationConstants.API_TIER.GOLD);
  serviceResponse=apiStoreTenant.subscribe(subscriptionRequest);
  verifyResponse(serviceResponse);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator(appName);
  String responseString=apiStoreTenant.generateApplicationKey(generateAppKeyRequest).getData();
  log.info(responseString);
  JSONObject response=new JSONObject(responseString);
  String accessToken=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  Assert.assertNotNull("String_Node_Str" + responseString,accessToken);
  requestHeaders.clear();
  requestHeaders.put(APIMIntegrationConstants.AUTHORIZATION_HEADER,"String_Node_Str" + accessToken);
  ApiHTTPInvocationURLTenant=getAPIInvocationURLHttp("String_Node_Str" + TENANT_WSO2 + "String_Node_Str"+ APIContext+ "String_Node_Str") + APIVersion;
  ApiHTTPSInvocationURLTenant=getAPIInvocationURLHttps("String_Node_Str" + TENANT_WSO2 + "String_Node_Str"+ APIContext+ "String_Node_Str") + APIVersion;
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testAPICreationTenant() throws Exception {
  apiStoreTenant=new APIStoreRestClient(storeURLHttp);
  apiStoreTenant.login(TENANT_WSO2_ADMIN,TENANT_WSO2_ADMIN_PASS);
  apiPublisherTenant=new APIPublisherRestClient(publisherURLHttp);
  apiPublisherTenant.login(TENANT_WSO2_ADMIN,TENANT_WSO2_ADMIN_PASS);
  apiRequestTenant=new APIRequest(apiName,APIContext,new URL(endpointUrl));
  apiRequestTenant.setTags(tags);
  apiRequestTenant.setDescription(description);
  apiRequestTenant.setVersion(APIVersion);
  apiRequestTenant.setProvider(TENANT_WSO2_ADMIN);
  HttpResponse serviceResponse=apiPublisherTenant.addAPI(apiRequestTenant);
  verifyResponse(serviceResponse);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(apiName,TENANT_WSO2_ADMIN,APILifeCycleState.PUBLISHED);
  serviceResponse=apiPublisherTenant.changeAPILifeCycleStatus(updateRequest);
  verifyResponse(serviceResponse);
  serviceResponse=apiStoreTenant.addApplication(appName,APIThrottlingTier.UNLIMITED.getState(),"String_Node_Str","String_Node_Str");
  verifyResponse(serviceResponse);
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(apiName,TENANT_WSO2_ADMIN);
  subscriptionRequest.setApplicationName(appName);
  subscriptionRequest.setTier(APIMIntegrationConstants.API_TIER.GOLD);
  serviceResponse=apiStoreTenant.subscribe(subscriptionRequest);
  verifyResponse(serviceResponse);
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator(appName);
  String responseString=apiStoreTenant.generateApplicationKey(generateAppKeyRequest).getData();
  JSONObject response=new JSONObject(responseString);
  String accessToken=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  Assert.assertNotNull("String_Node_Str" + responseString,accessToken);
  requestHeaders.clear();
  requestHeaders.put(APIMIntegrationConstants.AUTHORIZATION_HEADER,"String_Node_Str" + accessToken);
  ApiHTTPInvocationURLTenant=getAPIInvocationURLHttp("String_Node_Str" + TENANT_WSO2 + "String_Node_Str"+ APIContext+ "String_Node_Str") + APIVersion;
  ApiHTTPSInvocationURLTenant=getAPIInvocationURLHttps("String_Node_Str" + TENANT_WSO2 + "String_Node_Str"+ APIContext+ "String_Node_Str") + APIVersion;
}