@Test
public void testGetKeyManager_wrongType_shouldThrowException() throws Exception {

  try {
    Registry.getKeyManager(MacConfig.HMAC_TYPE_URL, Aead.class);
    fail("Expected GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    assertExceptionContains(e, "com.google.crypto.tink.Mac");
    assertExceptionContains(e, "com.google.crypto.tink.Aead not supported");
  }
}