@Test
  public void testCryptoJobExecutorService() throws GeneralSecurityException, InterruptedException {
    int totalDataCount = 10;
    CountDownLatch encryptCallBackCount = new CountDownLatch(totalDataCount * 3);
    CountDownLatch decryptCallBackCount = new CountDownLatch(totalDataCount * 3);
    SecretKeySpec perBlobKey = kms.getRandomKey();
    for (int i = 0; i < totalDataCount; i++) {
      testEncryptDecryptFlow(perBlobKey, encryptCallBackCount, decryptCallBackCount, Mode.Data);
      testEncryptDecryptFlow(perBlobKey, encryptCallBackCount, decryptCallBackCount, Mode.UserMetadata);
      testEncryptDecryptFlow(perBlobKey, encryptCallBackCount, decryptCallBackCount, Mode.Both);
    }
    awaitCountDownLatch(encryptCallBackCount, ENCRYPT_JOB_TYPE);
    awaitCountDownLatch(decryptCallBackCount, DECRYPT_JOB_TYPE);
  }
Tests {@link CryptoJobHandler} for happy path. i.e. Encrypt and Decrypt jobs are executed and callback invoked
@throws GeneralSecurityException
@throws InterruptedException
ambry-router/src/test/java/com/github/ambry/router/CryptoJobHandlerTest.java