@Test
  public void testChunkException() {
    BatchOperationCallbackTracker tracker =
        new BatchOperationCallbackTracker(chunkIds, finalBlobId, new FutureResult<>(), callback, quotaChargeCallback,
            finalOperation, router);
    tracker.getCallback(chunkIds.get(0))
        .onCompletion(null, new RouterException("test", RouterErrorCode.UnexpectedInternalError));
    Assert.assertTrue(tracker.isCompleted());
    Assert.assertTrue(trackerException instanceof RouterException);
    Assert.assertFalse(finalOperationCalled.get());
    Assert.assertEquals(RouterErrorCode.UnexpectedInternalError, ((RouterException) trackerException).getErrorCode());
  }
Test that if a data chunk has exception, the operation is completed and finalOperation is never attempted.
ambry-router/src/test/java/com/github/ambry/router/BatchOperationCallbackTrackerTest.java