Program: 114923
Project: 114923
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",priority=2) public void testCreateApiWithBothProdAndSandboxEndpoints() throws Exception {
  String descriptionSandbox="String_Node_Str";
  String tagsSandbox="String_Node_Str";
  firstProductionEndPoint=gatewayUrlsWrk.getWebAppURLHttp() + webApp1;
  secondProductionEndPoint=gatewayUrlsWrk.getWebAppURLHttp() + webApp2;
  thirdProductionEndPoint=gatewayUrlsWrk.getWebAppURLHttp() + webApp3;
  List<String> endpointProd=new ArrayList<String>();
  endpointProd.add(firstProductionEndPoint);
  endpointProd.add(secondProductionEndPoint);
  endpointProd.add(thirdProductionEndPoint);
  String firstSandboxEndpoint=gatewayUrlsWrk.getWebAppURLHttp() + firstWebAppSB;
  String secondSandboxEndpoint=gatewayUrlsWrk.getWebAppURLHttp() + secondWebAppSB;
  String thirdSandboxEndpoint=gatewayUrlsWrk.getWebAppURLHttp() + thirdWebAppSB;
  List<String> endpointSandbox=new ArrayList<String>();
  endpointSandbox.add(firstSandboxEndpoint);
  endpointSandbox.add(secondSandboxEndpoint);
  endpointSandbox.add(thirdSandboxEndpoint);
  providerName=publisherContext.getContextTenant().getContextUser().getUserName();
  APICreationRequestBean apiSBCreationRequestBean=new APICreationRequestBean(apiNameSandbox,contextSandbox,version,providerName,endpointProd,endpointSandbox);
  apiSBCreationRequestBean.setTier(tier);
  apiSBCreationRequestBean.setResourceBeanList(resourceBeanList);
  apiSBCreationRequestBean.setVisibility(visibility);
  apiSBCreationRequestBean.setTags(tagsSandbox);
  apiSBCreationRequestBean.setDescription(descriptionSandbox);
  apiSBCreationRequestBean.setEndpointType(endPointType);
  HttpResponse apiSBCreateResponse=apiPublisher.addAPI(apiSBCreationRequestBean);
  assertEquals(apiSBCreateResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject apiSBCreateJsonObject=new JSONObject(apiSBCreateResponse.getData());
  assertFalse(apiSBCreateJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
  HttpResponse verifyAPI=apiPublisher.getAPI(apiNameSandbox,providerName,version);
  assertEquals(verifyAPI.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject verifyApiJSONObject=new JSONObject(verifyAPI.getData());
  assertFalse(verifyApiJSONObject.getBoolean("String_Node_Str"),"String_Node_Str");
  APILifeCycleStateRequest updateStateRequest=new APILifeCycleStateRequest(apiNameSandbox,providerName,APILifeCycleState.PUBLISHED);
  HttpResponse stateUpdateResponse=apiPublisher.changeAPILifeCycleStatus(updateStateRequest);
  assertEquals(stateUpdateResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject apiPublishedJsonObject=new JSONObject(stateUpdateResponse.getData());
  assertFalse(apiPublishedJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",priority=2) public void testCreateApiWithBothProdAndSandboxEndpoints() throws Exception {
  String descriptionSandbox="String_Node_Str";
  String tagsSandbox="String_Node_Str";
  firstProductionEndPoint=gatewayUrlsWrk.getWebAppURLHttp() + webApp1;
  secondProductionEndPoint=gatewayUrlsWrk.getWebAppURLHttp() + webApp2;
  thirdProductionEndPoint=gatewayUrlsWrk.getWebAppURLHttp() + webApp3;
  List<String> endpointProd=new ArrayList<String>();
  endpointProd.add(firstProductionEndPoint);
  endpointProd.add(secondProductionEndPoint);
  endpointProd.add(thirdProductionEndPoint);
  String firstSandboxEndpoint=gatewayUrlsWrk.getWebAppURLHttp() + firstWebAppSB;
  String secondSandboxEndpoint=gatewayUrlsWrk.getWebAppURLHttp() + secondWebAppSB;
  String thirdSandboxEndpoint=gatewayUrlsWrk.getWebAppURLHttp() + thirdWebAppSB;
  List<String> endpointSandbox=new ArrayList<String>();
  endpointSandbox.add(firstSandboxEndpoint);
  endpointSandbox.add(secondSandboxEndpoint);
  endpointSandbox.add(thirdSandboxEndpoint);
  providerName=publisherContext.getContextTenant().getContextUser().getUserName();
  APICreationRequestBean apiSBCreationRequestBean=new APICreationRequestBean(apiNameSandbox,contextSandbox,version,providerName,endpointProd,endpointSandbox);
  apiSBCreationRequestBean.setTiersCollection(tier);
  apiSBCreationRequestBean.setResourceBeanList(resourceBeanList);
  apiSBCreationRequestBean.setVisibility(visibility);
  apiSBCreationRequestBean.setTags(tagsSandbox);
  apiSBCreationRequestBean.setDescription(descriptionSandbox);
  apiSBCreationRequestBean.setEndpointType(endPointType);
  HttpResponse apiSBCreateResponse=apiPublisher.addAPI(apiSBCreationRequestBean);
  assertEquals(apiSBCreateResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject apiSBCreateJsonObject=new JSONObject(apiSBCreateResponse.getData());
  assertFalse(apiSBCreateJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
  HttpResponse verifyAPI=apiPublisher.getAPI(apiNameSandbox,providerName,version);
  assertEquals(verifyAPI.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject verifyApiJSONObject=new JSONObject(verifyAPI.getData());
  assertFalse(verifyApiJSONObject.getBoolean("String_Node_Str"),"String_Node_Str");
  APILifeCycleStateRequest updateStateRequest=new APILifeCycleStateRequest(apiNameSandbox,providerName,APILifeCycleState.PUBLISHED);
  HttpResponse stateUpdateResponse=apiPublisher.changeAPILifeCycleStatus(updateStateRequest);
  assertEquals(stateUpdateResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject apiPublishedJsonObject=new JSONObject(stateUpdateResponse.getData());
  assertFalse(apiPublishedJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
}