@Test
  public void testOrigDcNotFound() throws Exception {
    router.close();
    Properties properties = getNonBlockingRouterProperties();
    VerifiableProperties vProps = new VerifiableProperties(properties);
    RouterConfig routerConfig = new RouterConfig(vProps);
    router = new NonBlockingRouter(routerConfig, new NonBlockingRouterMetrics(clusterMap, routerConfig),
        new MockNetworkClientFactory(vProps, mockSelectorState, MAX_PORTS_PLAIN_TEXT, MAX_PORTS_SSL,
            CHECKOUT_TIMEOUT_MS, serverLayout, mockTime), new LoggingNotificationSystem(), clusterMap, null, null, null,
        new InMemAccountService(false, true), mockTime, MockClusterMap.DEFAULT_PARTITION_CLASS, null);
    deleteManager =
        new DeleteManager(clusterMap, new ResponseHandler(clusterMap), accountService, notificationSystem, routerConfig,
            routerMetrics, new RouterCallback(null, new ArrayList<>()), mockTime, router);

    String originatingDcName = clusterMap.getDatacenterName(clusterMap.getLocalDatacenterId());
    List<MockServer> serversInLocalDc = new ArrayList<>();
    serverLayout.getMockServers().forEach(mockServer -> {
      if (mockServer.getDataCenter().equals(originatingDcName)) {
        serversInLocalDc.add(mockServer);
      }
    });

    // Default all replicas to return IO error which has higher precedence than NotFound.
    int serverCount = serverLayout.getMockServers().size();
    List<ServerErrorCode> serverErrorCodes = Collections.nCopies(serverCount, ServerErrorCode.IOError);
    setServerErrorCodes(serverErrorCodes, serverLayout);

    // Set NotFound error from all originating DC replicas.
    serversInLocalDc.get(0).setServerErrorForAllRequests(ServerErrorCode.BlobNotFound);
    serversInLocalDc.get(1).setServerErrorForAllRequests(ServerErrorCode.BlobNotFound);
    serversInLocalDc.get(2).setServerErrorForAllRequests(ServerErrorCode.BlobNotFound);

    // Verify that final error is BlobDoesNotExist.
    deleteErrorCodeChecker.testAndAssert(RouterErrorCode.BlobDoesNotExist);
  }
Test the case when all of the replicas in originating DC return NotFound, we should return BlobNotFound.
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/DeleteManagerTest.java