Program: 174736
Project: 174736
Buggy source:
@Test public void testInvalidRequests() throws Exception {
{
    try {
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person12Id));
      SiteMembershipRequest siteMembershipRequest=new SiteMembershipRequest();
      siteMembershipRequest.setId(person1ModeratedSites.get(0).getSiteId());
      siteMembershipRequest.setMessage("String_Node_Str");
      siteMembershipRequestsProxy.createSiteMembershipRequest(GUID.generate(),siteMembershipRequest);
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
    try {
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person12Id));
      SiteMembershipRequest siteMembershipRequest=new SiteMembershipRequest();
      siteMembershipRequest.setId(GUID.generate());
      siteMembershipRequest.setMessage("String_Node_Str");
      siteMembershipRequestsProxy.createSiteMembershipRequest(person11Id,siteMembershipRequest);
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
    try {
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person12Id));
      SiteMembershipRequest siteMembershipRequest=new SiteMembershipRequest();
      siteMembershipRequest.setId(person1ModeratedSites.get(0).getSiteId());
      siteMembershipRequest.setMessage("String_Node_Str");
      siteMembershipRequestsProxy.createSiteMembershipRequest(person11Id,siteMembershipRequest);
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
    try {
      log("String_Node_Str");
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person11Id));
      int skipCount=0;
      int maxItems=4;
      Paging paging=getPaging(skipCount,maxItems);
      siteMembershipRequestsProxy.getSiteMembershipRequests(person12Id,createParams(paging,null));
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
    try {
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person11Id));
      int skipCount=0;
      int maxItems=4;
      Paging paging=getPaging(skipCount,maxItems);
      siteMembershipRequestsProxy.getSiteMembershipRequests(GUID.generate(),createParams(paging,null));
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
{
{
        log("String_Node_Str");
        publicApiClient.setRequestContext(new RequestContext(network1.getId(),person14Id));
        SiteMembershipRequest siteMembershipRequest=new SiteMembershipRequest();
        siteMembershipRequest.setId(person1ModeratedSites.get(0).getSiteId());
        siteMembershipRequest.setMessage("String_Node_Str");
        siteMembershipRequestsProxy.createSiteMembershipRequest(person14Id,siteMembershipRequest);
        SiteMembershipRequest request=getSiteMembershipRequest(network1.getId(),person14Id,person14Id);
        try {
          publicApiClient.setRequestContext(new RequestContext(network1.getId(),person24Id));
          siteMembershipRequestsProxy.cancelSiteMembershipRequest(person14Id,request.getId());
          fail("String_Node_Str");
        }
 catch (        PublicApiException e) {
          assertEquals(HttpStatus.SC_UNAUTHORIZED,e.getHttpResponse().getStatusCode());
        }
        try {
          log("String_Node_Str");
          publicApiClient.setRequestContext(new RequestContext(network1.getId(),person14Id));
          siteMembershipRequestsProxy.cancelSiteMembershipRequest(GUID.generate(),request.getId());
          fail("String_Node_Str");
        }
 catch (        PublicApiException e) {
          assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
        }
      }
      try {
        log("String_Node_Str");
        log("String_Node_Str");
        publicApiClient.setRequestContext(new RequestContext(network1.getId(),person14Id));
        SiteMembershipRequest request=new SiteMembershipRequest();
        request.setId(GUID.generate());
        siteMembershipRequestsProxy.cancelSiteMembershipRequest(person14Id,request.getId());
        fail("String_Node_Str");
      }
 catch (      PublicApiException e) {
        assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
      }
      try {
        publicApiClient.setRequestContext(new RequestContext(network1.getId(),person14Id));
        siteMembershipRequestsProxy.cancelSiteMembershipRequest(person14Id,GUID.generate());
        fail("String_Node_Str");
      }
 catch (      PublicApiException e) {
        assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
      }
    }
    try {
      log("String_Node_Str");
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person11Id));
      SiteMembershipRequest request=new SiteMembershipRequest();
      request.setId(GUID.generate());
      request.setMessage("String_Node_Str");
      siteMembershipRequestsProxy.update("String_Node_Str",person11Id,"String_Node_Str",null,request.toJSON().toString(),"String_Node_Str");
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED,e.getHttpResponse().getStatusCode());
    }
    try {
      log("String_Node_Str");
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person11Id));
      SiteMembershipRequest request=new SiteMembershipRequest();
      request.setId(GUID.generate());
      request.setMessage("String_Node_Str");
      siteMembershipRequestsProxy.updateSiteMembershipRequest(person11Id,request);
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
  }
}

Fixed version (ground truth):
@Test public void testInvalidRequests() throws Exception {
{
    try {
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person12Id));
      SiteMembershipRequest siteMembershipRequest=new SiteMembershipRequest();
      siteMembershipRequest.setId(person1ModeratedSites.get(0).getSiteId());
      siteMembershipRequest.setMessage("String_Node_Str");
      siteMembershipRequestsProxy.createSiteMembershipRequest(GUID.generate(),siteMembershipRequest);
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
    try {
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person12Id));
      SiteMembershipRequest siteMembershipRequest=new SiteMembershipRequest();
      siteMembershipRequest.setId(GUID.generate());
      siteMembershipRequest.setMessage("String_Node_Str");
      siteMembershipRequestsProxy.createSiteMembershipRequest(person11Id,siteMembershipRequest);
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
    try {
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person12Id));
      SiteMembershipRequest siteMembershipRequest=new SiteMembershipRequest();
      siteMembershipRequest.setId(person1ModeratedSites.get(0).getSiteId());
      siteMembershipRequest.setMessage("String_Node_Str");
      siteMembershipRequestsProxy.createSiteMembershipRequest(person11Id,siteMembershipRequest);
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
    try {
      log("String_Node_Str");
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person11Id));
      int skipCount=0;
      int maxItems=4;
      Paging paging=getPaging(skipCount,maxItems);
      siteMembershipRequestsProxy.getSiteMembershipRequests(person12Id,createParams(paging,null));
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
    try {
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person11Id));
      int skipCount=0;
      int maxItems=4;
      Paging paging=getPaging(skipCount,maxItems);
      siteMembershipRequestsProxy.getSiteMembershipRequests(GUID.generate(),createParams(paging,null));
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
    try {
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person11Id));
      siteMembershipRequestsProxy.getSiteMembershipRequest(person11Id,GUID.generate());
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
{
{
        log("String_Node_Str");
        publicApiClient.setRequestContext(new RequestContext(network1.getId(),person14Id));
        SiteMembershipRequest siteMembershipRequest=new SiteMembershipRequest();
        siteMembershipRequest.setId(person1ModeratedSites.get(0).getSiteId());
        siteMembershipRequest.setMessage("String_Node_Str");
        siteMembershipRequestsProxy.createSiteMembershipRequest(person14Id,siteMembershipRequest);
        SiteMembershipRequest request=getSiteMembershipRequest(network1.getId(),person14Id,person14Id);
        try {
          publicApiClient.setRequestContext(new RequestContext(network1.getId(),person24Id));
          siteMembershipRequestsProxy.cancelSiteMembershipRequest(person14Id,request.getId());
          fail("String_Node_Str");
        }
 catch (        PublicApiException e) {
          assertEquals(HttpStatus.SC_UNAUTHORIZED,e.getHttpResponse().getStatusCode());
        }
        try {
          log("String_Node_Str");
          publicApiClient.setRequestContext(new RequestContext(network1.getId(),person14Id));
          siteMembershipRequestsProxy.cancelSiteMembershipRequest(GUID.generate(),request.getId());
          fail("String_Node_Str");
        }
 catch (        PublicApiException e) {
          assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
        }
      }
      try {
        log("String_Node_Str");
        log("String_Node_Str");
        publicApiClient.setRequestContext(new RequestContext(network1.getId(),person14Id));
        SiteMembershipRequest request=new SiteMembershipRequest();
        request.setId(GUID.generate());
        siteMembershipRequestsProxy.cancelSiteMembershipRequest(person14Id,request.getId());
        fail("String_Node_Str");
      }
 catch (      PublicApiException e) {
        assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
      }
      try {
        publicApiClient.setRequestContext(new RequestContext(network1.getId(),person14Id));
        siteMembershipRequestsProxy.cancelSiteMembershipRequest(person14Id,GUID.generate());
        fail("String_Node_Str");
      }
 catch (      PublicApiException e) {
        assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
      }
    }
    try {
      log("String_Node_Str");
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person11Id));
      SiteMembershipRequest request=new SiteMembershipRequest();
      request.setId(GUID.generate());
      request.setMessage("String_Node_Str");
      siteMembershipRequestsProxy.update("String_Node_Str",person11Id,"String_Node_Str",null,request.toJSON().toString(),"String_Node_Str");
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED,e.getHttpResponse().getStatusCode());
    }
    try {
      log("String_Node_Str");
      publicApiClient.setRequestContext(new RequestContext(network1.getId(),person11Id));
      SiteMembershipRequest request=new SiteMembershipRequest();
      request.setId(GUID.generate());
      request.setMessage("String_Node_Str");
      siteMembershipRequestsProxy.updateSiteMembershipRequest(person11Id,request);
      fail("String_Node_Str");
    }
 catch (    PublicApiException e) {
      assertEquals(HttpStatus.SC_NOT_FOUND,e.getHttpResponse().getStatusCode());
    }
  }
}