@Test
  public void testPutWithAllNodesFailure() throws Exception {
    requestAndResultsList.clear();
    requestAndResultsList.add(new RequestAndResult(chunkSize * 5));
    List<DataNodeId> dataNodeIds = mockClusterMap.getDataNodeIds();
    for (DataNodeId dataNodeId : dataNodeIds) {
      String host = dataNodeId.getHostname();
      int port = dataNodeId.getPort();
      MockServer server = mockServerLayout.getMockServer(host, port);
      server.setServerErrorForAllRequests(ServerErrorCode.UnknownError);
    }
    Exception expectedException = new RouterException("", RouterErrorCode.AmbryUnavailable);
    submitPutsAndAssertFailure(expectedException, true, false, true);
  }
Test ensures failure when all server nodes encounter an error.
ambry-router/src/test/java/com/github/ambry/router/PutManagerTest.java