private void sendRequestGetResponse(RestRequest restRequest, RestResponseChannel restResponseChannel)
      throws Exception {
    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicReference<Exception> exceptionRef = new AtomicReference<>();
    undeleteHandler.handle(restRequest, restResponseChannel, (result, exception) -> {
      exceptionRef.set(exception);
      latch.countDown();
    });
    assertTrue("Latch did not count down in time", latch.await(1, TimeUnit.SECONDS));
    if (exceptionRef.get() != null) {
      throw exceptionRef.get();
    }
  }
Sends the given {@link RestRequest} to the {@link UndeleteHandler} and waits for the response and returns it.
@param restRequest the {@link RestRequest} to send.
@param restResponseChannel the {@link RestResponseChannel} where headers will be set.
@throws Exception
ambry-frontend/src/test/java/com/github/ambry/frontend/UndeleteHandlerTest.java