private void verifySatisfactionOfRequests(String content, boolean shouldBeSatisfied) throws IOException {
    byte[] fullRequestBytesArr = TestUtils.getRandomBytes(18);
    RestServiceErrorCode REST_ERROR_CODE = RestServiceErrorCode.AccessDenied;
    HttpRequest httpRequest;
    // headers with error code
    HttpHeaders httpHeaders = new DefaultHttpHeaders();
    httpHeaders.set(MockNettyMessageProcessor.REST_SERVICE_ERROR_CODE_HEADER_NAME, REST_ERROR_CODE);
    httpHeaders.set(MockNettyMessageProcessor.INCLUDE_EXCEPTION_MESSAGE_IN_RESPONSE_HEADER_NAME, "true");
    for (HttpMethod httpMethod : Arrays.asList(HttpMethod.POST, HttpMethod.GET, HttpMethod.PUT, HttpMethod.DELETE,
        HttpMethod.HEAD)) {
      if (httpMethod == HttpMethod.POST || httpMethod == HttpMethod.GET) {
        // success POST/GET requests
        httpRequest = RestTestUtils.createRequest(httpMethod, "/", null);
        sendRequestAndEvaluateResponsePerformance(httpRequest, content, HttpResponseStatus.OK, shouldBeSatisfied);
      } else {
        // success PUT/DELETE/HEAD requests
        httpRequest = RestTestUtils.createFullRequest(httpMethod, TestingUri.ImmediateResponseComplete.toString(), null,
            fullRequestBytesArr);
        sendRequestAndEvaluateResponsePerformance(httpRequest, null, HttpResponseStatus.OK, shouldBeSatisfied);
      }
      // non-success PUT/DELETE/HEAD/POST/GET requests (3xx or 4xx status code)
      httpRequest =
          RestTestUtils.createFullRequest(httpMethod, TestingUri.OnResponseCompleteWithRestException.toString(),
              httpHeaders, fullRequestBytesArr);
      sendRequestAndEvaluateResponsePerformance(httpRequest, null, getExpectedHttpResponseStatus(REST_ERROR_CODE),
          shouldBeSatisfied);
      if (!shouldBeSatisfied) {
        // test 5xx status code
        httpHeaders.set(MockNettyMessageProcessor.REST_SERVICE_ERROR_CODE_HEADER_NAME,
            RestServiceErrorCode.InternalServerError);
        httpRequest =
            RestTestUtils.createFullRequest(httpMethod, TestingUri.OnResponseCompleteWithRestException.toString(),
                httpHeaders, fullRequestBytesArr);
        sendRequestAndEvaluateResponsePerformance(httpRequest, null,
            getExpectedHttpResponseStatus(RestServiceErrorCode.InternalServerError), false);
        httpHeaders.set(MockNettyMessageProcessor.REST_SERVICE_ERROR_CODE_HEADER_NAME, REST_ERROR_CODE);
      }
    }
  }
Verify satisfaction of all types of requests in both success and non-success cases.
@param content the http content used by POST request
@param shouldBeSatisfied whether the requests should be satisfied or not
@throws IOException
ambry-rest/src/test/java/com/github/ambry/rest/NettyResponseChannelTest.java