JcloudsProviderAndApiLoader { public static boolean isApi(String id) { if (Strings.isBlank(id)) return false; return getApi(id).isPresent(); }  static boolean isProvider(String id); static boolean isApi(String id); static Optional<ProviderMetadata> getProvider(String id); static Optional<ApiMetadata> getApi(String id); static final Logger log; }
@Test public void testRegisteredApi() throws Exception { String id = "my-example-api"; assertFalse(JcloudsProviderAndApiLoader.isApi(id)); ApiMetadata api = new MyExampleApiMetadata.Builder() .id(id) .name("My Example API") .identityName("myIdName") .documentation(URI.create("http: .build(); ApiRegistry.registerApi(api); try { assertIsApi(id); ApiRegistry.unRegisterApi(api); assertFalse(JcloudsProviderAndApiLoader.isApi(id)); } finally { ApiRegistry.unRegisterApi(api); } }