Program: 114830
Project: 114830
Buggy source:
@Test(groups="String_Node_Str",description="String_Node_Str") public void testAPIAccessWithInvalidToken() throws XPathExpressionException, APIManagerIntegrationTestException {
  apiPublisher.login(user.getUserName(),user.getPassword());
  String apiContext="String_Node_Str";
  String endpointUrl="String_Node_Str";
  APIRequest apiRequest=null;
  try {
    apiRequest=new APIRequest(API_NAME,apiContext,new URL(endpointUrl));
  }
 catch (  MalformedURLException e) {
    log.error("String_Node_Str" + endpointUrl,e);
    assertTrue(false);
  }
  apiRequest.setVersion(API_VERSION);
  apiRequest.setTiersCollection("String_Node_Str");
  apiRequest.setTier("String_Node_Str");
  apiRequest.setProvider(provider);
  apiPublisher.addAPI(apiRequest);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(API_NAME,user.getUserName(),APILifeCycleState.PUBLISHED);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
  waitForAPIDeploymentSync(apiRequest.getProvider(),apiRequest.getName(),apiRequest.getVersion(),APIMIntegrationConstants.IS_API_EXISTS);
  String apiInvocationUrl=getAPIInvocationURLHttp(apiContext,API_VERSION);
  Map<String,String> headers=new HashMap<String,String>();
  headers.put("String_Node_Str","String_Node_Str" + "String_Node_Str");
  try {
    HttpResponse httpResponse=HttpRequestUtil.doGet(apiInvocationUrl,headers);
    Assert.assertNotNull(httpResponse);
    Assert.assertEquals(401,httpResponse.getResponseCode());
    String responsePayload=httpResponse.getData();
    Assert.assertNotNull(responsePayload);
    String description=AXIOMUtil.stringToOM(responsePayload).getFirstChildWithName(new QName("String_Node_Str","String_Node_Str")).getText();
    Assert.assertNotNull("String_Node_Str",description);
    Assert.assertTrue("String_Node_Str" + "String_Node_Str" + description + "String_Node_Str",description.contains("String_Node_Str"));
  }
 catch (  IOException e) {
    log.error("String_Node_Str" + apiInvocationUrl,e);
    Assert.assertTrue("String_Node_Str" + apiInvocationUrl + "String_Node_Str"+ e.getMessage(),false);
  }
catch (  XMLStreamException e) {
    log.error("String_Node_Str",e);
    Assert.assertTrue("String_Node_Str" + e.getMessage(),false);
  }
}

Fixed version (ground truth):
@Test(groups="String_Node_Str",description="String_Node_Str") public void testAPIAccessWithInvalidToken() throws XPathExpressionException, APIManagerIntegrationTestException {
  apiPublisher.login(user.getUserName(),user.getPassword());
  String apiContext="String_Node_Str";
  String endpointUrl="String_Node_Str";
  APIRequest apiRequest=null;
  try {
    apiRequest=new APIRequest(API_NAME,apiContext,new URL(endpointUrl));
  }
 catch (  MalformedURLException e) {
    log.error("String_Node_Str" + endpointUrl,e);
    assertTrue(false);
  }
  apiRequest.setVersion(API_VERSION);
  apiRequest.setTiersCollection("String_Node_Str");
  apiRequest.setTier("String_Node_Str");
  apiRequest.setProvider(provider);
  apiPublisher.addAPI(apiRequest);
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(API_NAME,user.getUserName(),APILifeCycleState.PUBLISHED);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
  waitForAPIDeploymentSync(apiRequest.getProvider(),apiRequest.getName(),apiRequest.getVersion(),APIMIntegrationConstants.IS_API_EXISTS);
  String apiInvocationUrl=getAPIInvocationURLHttp(apiContext,API_VERSION);
  Map<String,String> headers=new HashMap<String,String>();
  headers.put("String_Node_Str","String_Node_Str" + "String_Node_Str");
  try {
    HttpResponse httpResponse=HttpRequestUtil.doGet(apiInvocationUrl,headers);
    Assert.assertNotNull(httpResponse);
    Assert.assertEquals(401,httpResponse.getResponseCode());
    String responsePayload=httpResponse.getData();
    Assert.assertNotNull(responsePayload);
    OMElement element=AXIOMUtil.stringToOM(responsePayload);
    AXIOMXPath xpath=new AXIOMXPath("String_Node_Str");
    xpath.addNamespace("String_Node_Str","String_Node_Str");
    xpath.addNamespace("String_Node_Str","String_Node_Str");
    Object descriptionElement=xpath.selectSingleNode(element);
    Assert.assertNotNull("String_Node_Str",descriptionElement);
    String description=((OMElement)descriptionElement).getText();
    Assert.assertTrue("String_Node_Str" + "String_Node_Str" + description + "String_Node_Str",description.contains("String_Node_Str"));
  }
 catch (  IOException e) {
    log.error("String_Node_Str" + apiInvocationUrl,e);
    Assert.assertTrue("String_Node_Str" + apiInvocationUrl + "String_Node_Str"+ e.getMessage(),false);
  }
catch (  XMLStreamException e) {
    log.error("String_Node_Str",e);
    Assert.assertTrue("String_Node_Str" + e.getMessage(),false);
  }
catch (  JaxenException e) {
    log.error("String_Node_Str",e);
    Assert.assertTrue("String_Node_Str" + e.getMessage(),false);
  }
}