@Test
  public void testSingleKMS() throws Exception {
    int[] keySizes = {16, 32, 64, 128};
    for (int keySize : keySizes) {
      String key = TestUtils.getRandomKey(keySize);
      Properties props = getKMSProperties(key, DEFAULT_RANDOM_KEY_SIZE_BITS);
      VerifiableProperties verifiableProperties = new VerifiableProperties((props));
      KMSConfig config = new KMSConfig(verifiableProperties);
      SecretKeySpec secretKeySpec = new SecretKeySpec(Hex.decode(key), config.kmsKeyGenAlgo);
      KeyManagementService<SecretKeySpec> kms =
          new SingleKeyManagementServiceFactory(verifiableProperties, CLUSTER_NAME, REGISTRY).getKeyManagementService();
      SecretKeySpec keyFromKMS =
          kms.getKey(null, Utils.getRandomShort(TestUtils.RANDOM), Utils.getRandomShort(TestUtils.RANDOM));
      Assert.assertEquals("Secret key mismatch ", secretKeySpec, keyFromKMS);
    }
  }
Test {@link SingleKeyManagementService#getKey(RestRequest, short, short)}
ambry-router/src/test/java/com/github/ambry/router/SingleKeyManagementServiceTest.java