@Test
  public void edgeCaseTest() throws Exception {
    AsyncRequestResponseHandler requestResponseHandler;
    RequestResponseHandlerMetrics metrics;

    // set request workers < 0
    try {
      requestResponseHandler = getAsyncRequestResponseHandler(-1);
      fail("Setting request workers < 0 should have thrown exception");
    } catch (IllegalArgumentException e) {
      // expected. nothing to do.
    }

    // set null RestRequestService
    try {
      RestRequestService restRequestService = new MockRestRequestService(verifiableProperties, router);
      metrics = new RequestResponseHandlerMetrics(new MetricRegistry());
      new AsyncRequestResponseHandler(metrics, 1, null);
      fail("Setting RestRequestService to null should have thrown exception");
    } catch (IllegalArgumentException e) {
      // expected. nothing to do.
    }
  }
Tests the behavior of {@link AsyncRequestResponseHandler} when request worker count or restRequestService is invalid.
@throws Exception
ambry-rest/src/test/java/com/github/ambry/rest/AsyncRequestResponseHandlerTest.java