@Test
public void testRegisterKeyManager_deprecated_WithKeyTypeNotSupported_shouldThrowException()
    throws Exception {

  String typeUrl = "yetSomeOtherTypeUrl";
  String differentTypeUrl = "differentTypeUrl";
  try {
    Registry.registerKeyManager(differentTypeUrl, new CustomAeadKeyManager(typeUrl));
    fail("Should throw an exception.");
  } catch (GeneralSecurityException e) {
    assertExceptionContains(e,
        "Manager does not support key type " + differentTypeUrl);
  }
}