@Test
public void aaaTestInitialization() throws Exception {

  try {
    Registry.getCatalogue("tinkmac");
    fail("Expected GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    assertThat(e.toString()).contains("no catalogue found");
    assertThat(e.toString()).contains("MacConfig.register()");
  }
  try {
    Registry.getCatalogue("tinkhybridencrypt");
    fail("Expected GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    assertThat(e.toString()).contains("no catalogue found");
    assertThat(e.toString()).contains("HybridConfig.register()");
  }
  try {
    Registry.getCatalogue("tinkhybriddecrypt");
    fail("Expected GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    assertThat(e.toString()).contains("no catalogue found");
    assertThat(e.toString()).contains("HybridConfig.register()");
  }
  String typeUrl = "type.googleapis.com/google.crypto.tink.EciesAeadHkdfPrivateKey";
  try {
    Registry.getUntypedKeyManager(typeUrl);
    fail("Expected GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    assertThat(e.toString()).contains("No key manager found");
  }
  // Initialize the config.
  HybridConfig.register();
  Registry.getKeyManager(typeUrl, HybridDecrypt.class);
  // Running init() manually again should succeed.
  HybridConfig.register();
}