Providers.of(globalRemoteStorageContext),
eventBus,
jmxInstaller,
null);
RemoteStorageContextCustomizer customizer = new RemoteStorageContextCustomizer(globalRemoteStorageContext);
final Builder builder = testSubject.prepare(customizer);
final RemoteAuthenticationSettings remoteAuthenticationSettings =
new UsernamePasswordRemoteAuthenticationSettings("user", "pass");
customizer.applyAuthenticationConfig(builder, remoteAuthenticationSettings, null);
final DefaultRemoteHttpProxySettings httpProxy = new DefaultRemoteHttpProxySettings();
httpProxy.setHostname("http-proxy");
httpProxy.setPort(8080);
httpProxy.setProxyAuthentication(new UsernamePasswordRemoteAuthenticationSettings("http-proxy", "http-pass"));
final DefaultRemoteHttpProxySettings httpsProxy = new DefaultRemoteHttpProxySettings();
httpsProxy.setHostname("https-proxy");
httpsProxy.setPort(9090);
httpsProxy.setProxyAuthentication(new UsernamePasswordRemoteAuthenticationSettings("https-proxy", "https-pass"));
final DefaultRemoteProxySettings remoteProxySettings = new DefaultRemoteProxySettings();
remoteProxySettings.setHttpProxySettings(httpProxy);
remoteProxySettings.setHttpsProxySettings(httpsProxy);
customizer.applyProxyConfig(builder, remoteProxySettings);
final CredentialsProvider credentialsProvider = builder.getCredentialsProvider();
assertThat(credentialsProvider.getCredentials(AuthScope.ANY), notNullValue(Credentials.class));
assertThat(credentialsProvider.getCredentials(AuthScope.ANY).getUserPrincipal().getName(), equalTo("user"));