Program: 114768
Project: 114768
Buggy source:
@Test(description="String_Node_Str") public void publishWebSocketAPI() throws Exception {
  apiPublisher=new APIPublisherRestClient(getPublisherURLHttp());
  apiStore=new APIStoreRestClient(getStoreURLHttp());
  provider=user.getUserName();
  String apiContext="String_Node_Str";
  String apiVersion="String_Node_Str";
  String webSocketServerHost=InetAddress.getLocalHost().getHostName();
  URI endpointUri=new URI("String_Node_Str" + webSocketServerHost + "String_Node_Str"+ webSocketServerPort);
  apiRequest=new APIRequest(apiName,apiContext,endpointUri,endpointUri);
  apiRequest.setVersion(apiVersion);
  apiRequest.setTiersCollection("String_Node_Str");
  apiRequest.setProvider(provider);
  apiRequest.setType("String_Node_Str");
  apiPublisher.login(user.getUserName(),user.getPassword());
  HttpResponse addAPIResponse=apiPublisher.addAPI(apiRequest);
  verifyResponse(addAPIResponse);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(apiName,user.getUserName(),APILifeCycleState.PUBLISHED);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
  waitForAPIDeploymentSync(user.getUserName(),apiName,apiVersion,APIMIntegrationConstants.IS_API_EXISTS);
  APIIdentifier apiIdentifierWebSocket=new APIIdentifier(provider,apiName,apiVersion);
  apiStore.login(storeContext.getContextTenant().getContextUser().getUserName(),storeContext.getContextTenant().getContextUser().getPassword());
  apiEndPoint=getWebSocketAPIInvocationURL(apiContext,apiVersion).replace("String_Node_Str","String_Node_Str");
  List<APIIdentifier> publisherAPIList=APIMTestCaseUtils.getAPIIdentifierListFromHttpResponse(apiPublisher.getAllAPIs());
  assertTrue(APIMTestCaseUtils.isAPIAvailable(apiIdentifierWebSocket,publisherAPIList),"String_Node_Str");
  List<APIIdentifier> storeAPIList=APIMTestCaseUtils.getAPIIdentifierListFromHttpResponse(apiStore.getAllPublishedAPIs());
  assertTrue(APIMTestCaseUtils.isAPIAvailable(apiIdentifierWebSocket,storeAPIList),"String_Node_Str");
}

Fixed version (ground truth):
@Test(description="String_Node_Str") public void publishWebSocketAPI() throws Exception {
  apiPublisher=new APIPublisherRestClient(getPublisherURLHttp());
  apiStore=new APIStoreRestClient(getStoreURLHttp());
  provider=user.getUserName();
  String apiContext="String_Node_Str";
  String apiVersion="String_Node_Str";
  URI endpointUri=new URI("String_Node_Str" + webSocketServerHost + "String_Node_Str"+ webSocketServerPort);
  apiRequest=new APIRequest(apiName,apiContext,endpointUri,endpointUri);
  apiRequest.setVersion(apiVersion);
  apiRequest.setTiersCollection("String_Node_Str");
  apiRequest.setProvider(provider);
  apiRequest.setType("String_Node_Str");
  apiPublisher.login(user.getUserName(),user.getPassword());
  HttpResponse addAPIResponse=apiPublisher.addAPI(apiRequest);
  verifyResponse(addAPIResponse);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(apiName,user.getUserName(),APILifeCycleState.PUBLISHED);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
  waitForAPIDeploymentSync(user.getUserName(),apiName,apiVersion,APIMIntegrationConstants.IS_API_EXISTS);
  APIIdentifier apiIdentifierWebSocket=new APIIdentifier(provider,apiName,apiVersion);
  apiStore.login(storeContext.getContextTenant().getContextUser().getUserName(),storeContext.getContextTenant().getContextUser().getPassword());
  apiEndPoint=getWebSocketAPIInvocationURL(apiContext,apiVersion).replace("String_Node_Str","String_Node_Str");
  List<APIIdentifier> publisherAPIList=APIMTestCaseUtils.getAPIIdentifierListFromHttpResponse(apiPublisher.getAllAPIs());
  assertTrue(APIMTestCaseUtils.isAPIAvailable(apiIdentifierWebSocket,publisherAPIList),"String_Node_Str");
  List<APIIdentifier> storeAPIList=APIMTestCaseUtils.getAPIIdentifierListFromHttpResponse(apiStore.getAllPublishedAPIs());
  assertTrue(APIMTestCaseUtils.isAPIAvailable(apiIdentifierWebSocket,storeAPIList),"String_Node_Str");
}