@Test
  public void testSingleKMSClose() throws Exception {
    String key = TestUtils.getRandomKey(DEFAULT_KEY_SIZE_CHARS);
    Properties props = getKMSProperties(key, DEFAULT_RANDOM_KEY_SIZE_BITS);
    VerifiableProperties verifiableProperties = new VerifiableProperties((props));
    KeyManagementService<SecretKeySpec> kms =
        new SingleKeyManagementServiceFactory(verifiableProperties, CLUSTER_NAME, REGISTRY).getKeyManagementService();
    kms.close();
    try {
      kms.getKey(null, Account.UNKNOWN_ACCOUNT_ID, Container.UNKNOWN_CONTAINER_ID);
      Assert.fail("getKey() on KMS should have failed as KMS is closed");
    } catch (GeneralSecurityException e) {
    }
  }
Test the {@link SingleKeyManagementService} for close()
ambry-router/src/test/java/com/github/ambry/router/SingleKeyManagementServiceTest.java