@Test
  public void testVariousServerErrorCode() throws Exception {
    HashMap<ServerErrorCode, RouterErrorCode> map = new HashMap<>();
    map.put(ServerErrorCode.BlobExpired, RouterErrorCode.BlobExpired);
    map.put(ServerErrorCode.BlobNotFound, RouterErrorCode.BlobDoesNotExist);
    map.put(ServerErrorCode.DiskUnavailable, RouterErrorCode.AmbryUnavailable);
    map.put(ServerErrorCode.ReplicaUnavailable, RouterErrorCode.AmbryUnavailable);
    map.put(ServerErrorCode.BlobAuthorizationFailure, RouterErrorCode.BlobAuthorizationFailure);
    for (ServerErrorCode serverErrorCode : ServerErrorCode.values()) {
      if (serverErrorCode != ServerErrorCode.NoError && serverErrorCode != ServerErrorCode.BlobDeleted
          && !map.containsKey(serverErrorCode)) {
        map.put(serverErrorCode, RouterErrorCode.UnexpectedInternalError);
      }
    }
    for (Map.Entry<ServerErrorCode, RouterErrorCode> entity : map.entrySet()) {
      // Reset not-found cache after each test since we are using same blob ID for all error codes
      router.getNotFoundCache().invalidateAll();
      testWithErrorCodes(Collections.singletonMap(entity.getKey(), 9), serverLayout, entity.getValue(),
          deleteErrorCodeChecker);
    }
  }
Test if the {@link RouterErrorCode} is as expected for different {@link ServerErrorCode}.
ambry-router/src/test/java/com/github/ambry/router/DeleteManagerTest.java