@Test
public void aaaTestInitialization() throws Exception {

  try {
    Registry.getCatalogue("tinkstreamingaead");
    fail("Expected GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    assertThat(e.toString()).contains("no catalogue found");
    assertThat(e.toString()).contains("StreamingAeadConfig.register()");
  }
  try {
    Registry.getCatalogue("TinkStreamingAead");
    fail("Expected GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    assertThat(e.toString()).contains("no catalogue found");
    assertThat(e.toString()).contains("StreamingAeadConfig.register()");
  }
  String typeUrl = "type.googleapis.com/google.crypto.tink.AesCtrHmacStreamingKey";
  try {
    Registry.getUntypedKeyManager(typeUrl);
    fail("Expected GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    assertThat(e.toString()).contains("No key manager found");
  }
  // Initialize the config.
  StreamingAeadConfig.register();
  // After registration the key manager should be present.
  Registry.getKeyManager(typeUrl, StreamingAead.class);
  // Running init() manually again should succeed.
  StreamingAeadConfig.register();
}