Program: 114858
Project: 114858
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void testAPISearchByTag() throws Exception {
  String searchTerm;
  HttpResponse response;
  JSONObject results;
  JSONArray resultArray;
  searchTerm="String_Node_Str" + TAG_API;
  response=apiStore.searchPaginateAPIs(user.getUserDomain(),"String_Node_Str","String_Node_Str",searchTerm);
  verifyResponse(response);
  results=new JSONObject(response.getData());
  resultArray=results.getJSONArray("String_Node_Str");
  Assert.assertEquals(resultArray.length(),2,"String_Node_Str");
  Assert.assertTrue(response.getData().contains(API_NAME_1),"String_Node_Str");
  Assert.assertTrue(response.getData().contains(API_NAME_2),"String_Node_Str");
  searchTerm="String_Node_Str" + TAG_API_1;
  response=apiStore.searchPaginateAPIs(user.getUserDomain(),"String_Node_Str","String_Node_Str",searchTerm);
  verifyResponse(response);
  results=new JSONObject(response.getData());
  resultArray=results.getJSONArray("String_Node_Str");
  Assert.assertEquals(resultArray.length(),1,"String_Node_Str");
  Assert.assertTrue(response.getData().contains(API_NAME_1),"String_Node_Str");
  Assert.assertFalse(response.getData().contains(API_NAME_2),"String_Node_Str");
  searchTerm="String_Node_Str" + TAG_NOT_EXIST;
  response=apiStore.searchPaginateAPIs(user.getUserDomain(),"String_Node_Str","String_Node_Str",searchTerm);
  verifyResponse(response);
  results=new JSONObject(response.getData());
  resultArray=results.getJSONArray("String_Node_Str");
  Assert.assertEquals(resultArray.length(),0,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void testAPISearchByTag() throws Exception {
  String searchTerm;
  HttpResponse response;
  JSONObject results;
  JSONArray resultArray;
  watForAPIsAvailableOnSearchApi();
  searchTerm="String_Node_Str" + TAG_API;
  response=apiStore.searchPaginateAPIs(user.getUserDomain(),"String_Node_Str","String_Node_Str",searchTerm);
  verifyResponse(response);
  results=new JSONObject(response.getData());
  resultArray=results.getJSONArray("String_Node_Str");
  Assert.assertEquals(resultArray.length(),2,"String_Node_Str");
  Assert.assertTrue(response.getData().contains(API_NAME_1),"String_Node_Str");
  Assert.assertTrue(response.getData().contains(API_NAME_2),"String_Node_Str");
  searchTerm="String_Node_Str" + TAG_API_1;
  response=apiStore.searchPaginateAPIs(user.getUserDomain(),"String_Node_Str","String_Node_Str",searchTerm);
  verifyResponse(response);
  results=new JSONObject(response.getData());
  resultArray=results.getJSONArray("String_Node_Str");
  Assert.assertEquals(resultArray.length(),1,"String_Node_Str");
  Assert.assertTrue(response.getData().contains(API_NAME_1),"String_Node_Str");
  Assert.assertFalse(response.getData().contains(API_NAME_2),"String_Node_Str");
  searchTerm="String_Node_Str" + TAG_NOT_EXIST;
  response=apiStore.searchPaginateAPIs(user.getUserDomain(),"String_Node_Str","String_Node_Str",searchTerm);
  verifyResponse(response);
  results=new JSONObject(response.getData());
  resultArray=results.getJSONArray("String_Node_Str");
  Assert.assertEquals(resultArray.length(),0,"String_Node_Str");
}