@Test(expected = ConfigException.class) public void testNullUserInfo() throws MalformedURLException { Map<String, Object> clientConfig = new HashMap<>(); UserInfoCredentialProvider provider = new UserInfoCredentialProvider(); provider.configure(clientConfig); }
@Override public void configure(Map<String, ?> configs) { userInfo = (String) configs.get(SchemaRegistryClientConfig.SCHEMA_REGISTRY_USER_INFO_CONFIG); if (userInfo != null && !userInfo.isEmpty()) { return; } userInfo = (String) configs.get(SchemaRegistryClientConfig.USER_INFO_CONFIG); if (userInfo != null && !userInfo.isEmpty()) { return; } throw new ConfigException("UserInfo must be provided when basic.auth.credentials.source is " + "set to USER_INFO"); }
UserInfoCredentialProvider implements BasicAuthCredentialProvider { @Override public void configure(Map<String, ?> configs) { userInfo = (String) configs.get(SchemaRegistryClientConfig.SCHEMA_REGISTRY_USER_INFO_CONFIG); if (userInfo != null && !userInfo.isEmpty()) { return; } userInfo = (String) configs.get(SchemaRegistryClientConfig.USER_INFO_CONFIG); if (userInfo != null && !userInfo.isEmpty()) { return; } throw new ConfigException("UserInfo must be provided when basic.auth.credentials.source is " + "set to USER_INFO"); } }
UserInfoCredentialProvider implements BasicAuthCredentialProvider { @Override public void configure(Map<String, ?> configs) { userInfo = (String) configs.get(SchemaRegistryClientConfig.SCHEMA_REGISTRY_USER_INFO_CONFIG); if (userInfo != null && !userInfo.isEmpty()) { return; } userInfo = (String) configs.get(SchemaRegistryClientConfig.USER_INFO_CONFIG); if (userInfo != null && !userInfo.isEmpty()) { return; } throw new ConfigException("UserInfo must be provided when basic.auth.credentials.source is " + "set to USER_INFO"); }  }
UserInfoCredentialProvider implements BasicAuthCredentialProvider { @Override public void configure(Map<String, ?> configs) { userInfo = (String) configs.get(SchemaRegistryClientConfig.SCHEMA_REGISTRY_USER_INFO_CONFIG); if (userInfo != null && !userInfo.isEmpty()) { return; } userInfo = (String) configs.get(SchemaRegistryClientConfig.USER_INFO_CONFIG); if (userInfo != null && !userInfo.isEmpty()) { return; } throw new ConfigException("UserInfo must be provided when basic.auth.credentials.source is " + "set to USER_INFO"); }  @Override String alias(); @Override void configure(Map<String, ?> configs); @Override String getUserInfo(URL url); }
UserInfoCredentialProvider implements BasicAuthCredentialProvider { @Override public void configure(Map<String, ?> configs) { userInfo = (String) configs.get(SchemaRegistryClientConfig.SCHEMA_REGISTRY_USER_INFO_CONFIG); if (userInfo != null && !userInfo.isEmpty()) { return; } userInfo = (String) configs.get(SchemaRegistryClientConfig.USER_INFO_CONFIG); if (userInfo != null && !userInfo.isEmpty()) { return; } throw new ConfigException("UserInfo must be provided when basic.auth.credentials.source is " + "set to USER_INFO"); }  @Override String alias(); @Override void configure(Map<String, ?> configs); @Override String getUserInfo(URL url);  }