@Test
  public void testCryptoServiceFailure() throws Exception {
    if (testEncryption) {
      // simple Blob
      blobSize = random.nextInt(maxChunkSize) + 1;
      doPut();
      cryptoService.exceptionOnDecryption.set(GSE);
      GetBlobOperation op = createOperationAndComplete(null);
      assertFailureAndCheckErrorCode(op, RouterErrorCode.UnexpectedInternalError);

      // composite blob
      cryptoService.exceptionOnDecryption.set(null);
      blobSize = maxChunkSize * random.nextInt(10);
      doPut();
      cryptoService.exceptionOnDecryption.set(GSE);
      op = createOperationAndComplete(null);
      assertFailureAndCheckErrorCode(op, RouterErrorCode.UnexpectedInternalError);
    }
  }
Test failure with CryptoService
@throws Exception
ambry-router/src/test/java/com/github/ambry/router/GetBlobOperationTest.java