protected void assertClosed() {
    Future<String> future =
        router.putBlob(putBlobProperties, putUserMetadata, putChannel, new PutBlobOptionsBuilder().build());
    Assert.assertTrue(future.isDone());
    try {
      ((CompletableFuture<?>) future).join();
      Assert.fail("Excepting failure");
    } catch (Exception e) {
      RouterException routerException = (RouterException) Utils.extractFutureExceptionCause(e);
      Assert.assertEquals(routerException.getErrorCode(), RouterErrorCode.RouterClosed);
    }
  }
Assert that submission after closing the router returns a future that is already done and an appropriate
exception.
ambry-router/src/test/java/com/github/ambry/router/NonBlockingRouterTestBase.java