@Override
          public void testAndAssert(RouterErrorCode expectedError) throws Exception {
            Callback<GetBlobResult> callback = new Callback<GetBlobResult>() {
              @Override
              public void onCompletion(final GetBlobResult result, final Exception exception) {
                if (exception != null) {
                  asyncWritableChannel.close();
                  readCompleteLatch.countDown();
                } else {
                  Utils.newThread(new Runnable() {
                    @Override
                    public void run() {
                      try {
                        result.getBlobDataChannel().readInto(asyncWritableChannel, new Callback<Long>() {
                          @Override
                          public void onCompletion(Long result, Exception exception) {
                            asyncWritableChannel.close();
                          }
                        });
                        asyncWritableChannel.getNextChunk();
                      } catch (Exception e) {
                        readCompleteException.set(e);
                      } finally {
                        readCompleteLatch.countDown();
                      }
                    }
                  }, false).start();
                }
              }
            };
            GetBlobOperation op = createOperationAndComplete(callback);
            Assert.assertTrue(readCompleteLatch.await(2, TimeUnit.SECONDS));
            Assert.assertTrue("Operation should be complete at this time", op.isOperationComplete());
            if (readCompleteException.get() != null) {
              throw readCompleteException.get();
            }
            Assert.assertFalse("AsyncWriteableChannel should have been closed.", asyncWritableChannel.isOpen());
            assertFailureAndCheckErrorCode(op, expectedError);
          }
Test that an operation is completed with a specified {@link RouterErrorCode} when all gets on data chunks
in a multi-part blob return a specified {@link ServerErrorCode}
@param serverErrorCode The error code to be returned when fetching data chunks.
@param expectedErrorCode The operation's expected error code.
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/GetBlobOperationTest.java