Program: 114957
Project: 114957
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void testPagination(){
  int numberOfAPIs=24;
  boolean isLoginSuccess=false;
  boolean isPaginationCorrect=false;
  String storeURLHttp=storeUrls.getWebAppURLHttp();
  APIStoreRestClient apiStore=new APIStoreRestClient(storeURLHttp);
  HttpResponse storeLoginResponse=null;
  String successResponse="String_Node_Str";
  try {
    for (int i=0; i < numberOfAPIs; i++) {
      String APIName="String_Node_Str" + Integer.toString(i);
      String APIContext="String_Node_Str" + Integer.toString(i);
      String tags="String_Node_Str";
      String url="String_Node_Str";
      String description="String_Node_Str";
      String providerName=publisherContext.getContextTenant().getTenantAdmin().getUserName() + "String_Node_Str" + tenantDomain;
      String APIVersion="String_Node_Str";
      APIPublisherRestClient apiPublisher=new APIPublisherRestClient(publisherURLHttp);
      apiPublisher.login(publisherContext.getContextTenant().getTenantAdmin().getUserName() + "String_Node_Str" + tenantDomain,publisherContext.getContextTenant().getTenantAdmin().getPassword());
      APIRequest apiRequest=new APIRequest(APIName,APIContext,new URL(url));
      apiRequest.setTags(tags);
      apiRequest.setDescription(description);
      apiRequest.setVersion(APIVersion);
      apiRequest.setSandbox(url);
      apiRequest.setResourceMethod("String_Node_Str");
      apiRequest.setProvider(providerName);
      apiPublisher.addAPI(apiRequest);
      APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(APIName,providerName,APILifeCycleState.PUBLISHED);
      apiPublisher.changeAPILifeCycleStatus(updateRequest);
    }
    Thread.sleep(60000);
    storeLoginResponse=apiStore.login("String_Node_Str","String_Node_Str");
  }
 catch (  XPathExpressionException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  APIManagerIntegrationTestException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  MalformedURLException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  InterruptedException e) {
    assertTrue(false,"String_Node_Str");
  }
  String loginResponseCookie=null;
  if (storeLoginResponse != null) {
    loginResponseCookie=storeLoginResponse.getHeaders().get("String_Node_Str");
    if (successResponse.equals(storeLoginResponse.getData())) {
      isLoginSuccess=true;
    }
  }
  if (isLoginSuccess && loginResponseCookie != null) {
    int offset=10;
    int countInFirstPage=getPaginationElementsCount(storeURLHttp,loginResponseCookie,0,offset);
    int countInSecondPage=getPaginationElementsCount(storeURLHttp,loginResponseCookie,10,offset);
    int countInThirdPage=getPaginationElementsCount(storeURLHttp,loginResponseCookie,20,offset);
    if (countInFirstPage == 10 && countInSecondPage == 10 && countInThirdPage == 4) {
      isPaginationCorrect=true;
    }
  }
  assertTrue(isPaginationCorrect,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void testPagination() throws Exception {
  int numberOfAPIs=24;
  boolean isLoginSuccess=false;
  boolean isPaginationCorrect=false;
  String storeURLHttp=storeUrls.getWebAppURLHttp();
  APIStoreRestClient apiStore=new APIStoreRestClient(storeURLHttp);
  HttpResponse storeLoginResponse=null;
  String successResponse="String_Node_Str";
  try {
    for (int i=0; i < numberOfAPIs; i++) {
      String APIName="String_Node_Str" + Integer.toString(i);
      String APIContext="String_Node_Str" + Integer.toString(i);
      String tags="String_Node_Str";
      String url="String_Node_Str";
      String description="String_Node_Str";
      String providerName=publisherContext.getContextTenant().getTenantAdmin().getUserName() + "String_Node_Str" + tenantDomain;
      String APIVersion="String_Node_Str";
      APIPublisherRestClient apiPublisher=new APIPublisherRestClient(publisherURLHttp);
      apiPublisher.login(publisherContext.getContextTenant().getTenantAdmin().getUserName() + "String_Node_Str" + tenantDomain,publisherContext.getContextTenant().getTenantAdmin().getPassword());
      APIRequest apiRequest=new APIRequest(APIName,APIContext,new URL(url));
      apiRequest.setTags(tags);
      apiRequest.setDescription(description);
      apiRequest.setVersion(APIVersion);
      apiRequest.setSandbox(url);
      apiRequest.setResourceMethod("String_Node_Str");
      apiRequest.setProvider(providerName);
      apiPublisher.addAPI(apiRequest);
      APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(APIName,providerName,APILifeCycleState.PUBLISHED);
      apiPublisher.changeAPILifeCycleStatus(updateRequest);
    }
    Thread.sleep(60000);
    storeLoginResponse=apiStore.login("String_Node_Str","String_Node_Str");
  }
 catch (  XPathExpressionException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  APIManagerIntegrationTestException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  MalformedURLException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  InterruptedException e) {
    assertTrue(false,"String_Node_Str");
  }
  String loginResponseCookie=null;
  if (storeLoginResponse != null) {
    loginResponseCookie=storeLoginResponse.getHeaders().get("String_Node_Str");
    if (successResponse.equals(storeLoginResponse.getData())) {
      isLoginSuccess=true;
    }
  }
  if (isLoginSuccess && loginResponseCookie != null) {
    int offset=10;
    int countInFirstPage=getPaginationElementsCount(storeURLHttp,loginResponseCookie,0,offset);
    int countInSecondPage=getPaginationElementsCount(storeURLHttp,loginResponseCookie,10,offset);
    int countInThirdPage=getPaginationElementsCount(storeURLHttp,loginResponseCookie,20,offset);
    if (countInFirstPage == 10 && countInSecondPage == 10 && countInThirdPage == 4) {
      isPaginationCorrect=true;
    }
  }
  assertTrue(isPaginationCorrect,"String_Node_Str");
}