@Test
  public void handleRequestFailureBeforeQueueTest() throws Exception {
    // RestRequest null.
    try {
      asyncRequestResponseHandler.handleRequest(null, new MockRestResponseChannel());
      fail("Test should have thrown exception, but did not");
    } catch (IllegalArgumentException e) {
      // expected. Nothing to do.
    }

    // RestResponseChannel null.
    RestRequest restRequest = createRestRequest(RestMethod.GET, "/", new JSONObject(), null);
    try {
      asyncRequestResponseHandler.handleRequest(restRequest, null);
      fail("Test should have thrown exception, but did not");
    } catch (IllegalArgumentException e) {
      // expected. Nothing to do.
    }

    // AsyncRequestResponseHandler should still be alive and serving requests
    assertTrue("AsyncRequestResponseHandler is dead", asyncRequestResponseHandler.isRunning());
  }
Tests that right exceptions are thrown on bad input to
{@link AsyncRequestResponseHandler#handleRequest(RestRequest, RestResponseChannel)}. These are exceptions that get
thrown before queuing.
@throws Exception
ambry-rest/src/test/java/com/github/ambry/rest/AsyncRequestResponseHandlerTest.java