use of org.eclipse.aether.repository.AuthenticationContext in project spring-boot by spring-projects.
the class SettingsXmlRepositorySystemSessionAutoConfigurationTests method assertAuthenticationSelectorConfiguration.
private void assertAuthenticationSelectorConfiguration(DefaultRepositorySystemSession session, RemoteRepository repository) {
Authentication authentication = session.getAuthenticationSelector().getAuthentication(repository);
repository = new RemoteRepository.Builder(repository).setAuthentication(authentication).build();
AuthenticationContext authenticationContext = AuthenticationContext.forRepository(session, repository);
assertThat(authenticationContext.get(AuthenticationContext.USERNAME)).isEqualTo("tester");
assertThat(authenticationContext.get(AuthenticationContext.PASSWORD)).isEqualTo("secret");
}
use of org.eclipse.aether.repository.AuthenticationContext in project spring-boot by spring-projects.
the class SettingsXmlRepositorySystemSessionAutoConfigurationTests method assertProxySelectorConfiguration.
private void assertProxySelectorConfiguration(DefaultRepositorySystemSession session, RemoteRepository repository) {
Proxy proxy = session.getProxySelector().getProxy(repository);
repository = new RemoteRepository.Builder(repository).setProxy(proxy).build();
AuthenticationContext authenticationContext = AuthenticationContext.forProxy(session, repository);
assertThat(proxy.getHost()).isEqualTo("proxy.example.com");
assertThat(authenticationContext.get(AuthenticationContext.USERNAME)).isEqualTo("proxyuser");
assertThat(authenticationContext.get(AuthenticationContext.PASSWORD)).isEqualTo("somepassword");
}
Aggregations