@Test
  public void testRouterNoPartitionInLocalDC() throws Exception {
    try {
      // set the local DC to invalid, so that for puts, no partitions are available locally.
      Properties props = getNonBlockingRouterProperties("invalidDC");
      setRouter(props, new MockServerLayout(mockClusterMap), new LoggingNotificationSystem());
      setOperationParams();
      try {
        router.putBlob(putBlobProperties, putUserMetadata, putChannel, new PutBlobOptionsBuilder().build()).get();
        Assert.fail("Put should have failed if there are no partitions");
      } catch (Exception e) {
        RouterException r = (RouterException) e.getCause();
        Assert.assertEquals(RouterErrorCode.UnexpectedInternalError, r.getErrorCode());
      }
    } finally {
      if (router != null) {
        router.close();
        assertExpectedThreadCounts(0, 0);
        assertClosed();
      }
    }
  }
Test router put operation in a scenario where there are partitions, but none in the local DC.
This should not ideally happen unless there is a bad config, but the router should be resilient and
just error out these operations.
ambry-router/src/test/java/com/github/ambry/router/NonBlockingRouterTest.java