@Test
  public void testCryptoJobHandlerClose() throws GeneralSecurityException {
    SecretKeySpec perBlobKey = kms.getRandomKey();
    TestBlobData randomData = getRandomBlob(referenceClusterMap);
    cryptoJobHandler.close();

    cryptoJobHandler.submitJob(
        new EncryptJob(randomData.blobId.getAccountId(), randomData.blobId.getContainerId(), randomData.blobContent,
            randomData.userMetadata, perBlobKey, cryptoService, kms, null,
            new CryptoJobMetricsTracker(routerMetrics.encryptJobMetrics),
            (EncryptJob.EncryptJobResult result, Exception exception) -> {
              fail("Callback should not have been called since CryptoWorker is closed");
            }));

    cryptoJobHandler.submitJob(
        new DecryptJob(randomData.blobId, randomData.blobContent.nioBuffer(), randomData.blobContent,
            randomData.userMetadata, cryptoService, kms, null, new CryptoJobMetricsTracker(routerMetrics.decryptJobMetrics),
            (DecryptJob.DecryptJobResult result, Exception exception) -> {
              fail("Callback should not have been called since CryptoWorker is closed");
            }));
    randomData.blobContent.release();
  }
Tests {@link CryptoJobHandler} for encrypt and decrypt calls after closing the thread
@throws GeneralSecurityException
ambry-router/src/test/java/com/github/ambry/router/CryptoJobHandlerTest.java