@Test public void testSuccess() { assertInstance(BearerAuthCredentialProviderFactory.getBearerAuthCredentialProvider( "STATIC_TOKEN", CONFIG_MAP), StaticTokenCredentialProvider.class); }
public static BearerAuthCredentialProvider getBearerAuthCredentialProvider( String bearerAuthCredentialSource, Map<String, ?> configs) { ServiceLoader<BearerAuthCredentialProvider> serviceLoader = ServiceLoader.load( BearerAuthCredentialProvider.class, BearerAuthCredentialProviderFactory.class.getClassLoader() ); for (BearerAuthCredentialProvider bearerAuthCredentialProvider : serviceLoader) { if (bearerAuthCredentialProvider.alias().equals(bearerAuthCredentialSource)) { bearerAuthCredentialProvider.configure(configs); return bearerAuthCredentialProvider; } } return null; }
BearerAuthCredentialProviderFactory { public static BearerAuthCredentialProvider getBearerAuthCredentialProvider( String bearerAuthCredentialSource, Map<String, ?> configs) { ServiceLoader<BearerAuthCredentialProvider> serviceLoader = ServiceLoader.load( BearerAuthCredentialProvider.class, BearerAuthCredentialProviderFactory.class.getClassLoader() ); for (BearerAuthCredentialProvider bearerAuthCredentialProvider : serviceLoader) { if (bearerAuthCredentialProvider.alias().equals(bearerAuthCredentialSource)) { bearerAuthCredentialProvider.configure(configs); return bearerAuthCredentialProvider; } } return null; } }
BearerAuthCredentialProviderFactory { public static BearerAuthCredentialProvider getBearerAuthCredentialProvider( String bearerAuthCredentialSource, Map<String, ?> configs) { ServiceLoader<BearerAuthCredentialProvider> serviceLoader = ServiceLoader.load( BearerAuthCredentialProvider.class, BearerAuthCredentialProviderFactory.class.getClassLoader() ); for (BearerAuthCredentialProvider bearerAuthCredentialProvider : serviceLoader) { if (bearerAuthCredentialProvider.alias().equals(bearerAuthCredentialSource)) { bearerAuthCredentialProvider.configure(configs); return bearerAuthCredentialProvider; } } return null; }  }
BearerAuthCredentialProviderFactory { public static BearerAuthCredentialProvider getBearerAuthCredentialProvider( String bearerAuthCredentialSource, Map<String, ?> configs) { ServiceLoader<BearerAuthCredentialProvider> serviceLoader = ServiceLoader.load( BearerAuthCredentialProvider.class, BearerAuthCredentialProviderFactory.class.getClassLoader() ); for (BearerAuthCredentialProvider bearerAuthCredentialProvider : serviceLoader) { if (bearerAuthCredentialProvider.alias().equals(bearerAuthCredentialSource)) { bearerAuthCredentialProvider.configure(configs); return bearerAuthCredentialProvider; } } return null; }  static BearerAuthCredentialProvider getBearerAuthCredentialProvider(
      String bearerAuthCredentialSource,
      Map<String, ?> configs); }
BearerAuthCredentialProviderFactory { public static BearerAuthCredentialProvider getBearerAuthCredentialProvider( String bearerAuthCredentialSource, Map<String, ?> configs) { ServiceLoader<BearerAuthCredentialProvider> serviceLoader = ServiceLoader.load( BearerAuthCredentialProvider.class, BearerAuthCredentialProviderFactory.class.getClassLoader() ); for (BearerAuthCredentialProvider bearerAuthCredentialProvider : serviceLoader) { if (bearerAuthCredentialProvider.alias().equals(bearerAuthCredentialSource)) { bearerAuthCredentialProvider.configure(configs); return bearerAuthCredentialProvider; } } return null; }  static BearerAuthCredentialProvider getBearerAuthCredentialProvider(
      String bearerAuthCredentialSource,
      Map<String, ?> configs);  }