DefaultRepositorySystemSession implements RepositorySystemSession { public AuthenticationSelector getAuthenticationSelector() { return authenticationSelector; } DefaultRepositorySystemSession();  DefaultRepositorySystemSession( RepositorySystemSession session ); boolean isOffline(); DefaultRepositorySystemSession setOffline( boolean offline ); boolean isTransferErrorCachingEnabled(); DefaultRepositorySystemSession setTransferErrorCachingEnabled( boolean transferErrorCachingEnabled ); boolean isNotFoundCachingEnabled(); DefaultRepositorySystemSession setNotFoundCachingEnabled( boolean notFoundCachingEnabled ); boolean isIgnoreMissingArtifactDescriptor(); DefaultRepositorySystemSession setIgnoreMissingArtifactDescriptor( boolean ignoreMissingArtifactDescriptor ); boolean isIgnoreInvalidArtifactDescriptor(); DefaultRepositorySystemSession setIgnoreInvalidArtifactDescriptor( boolean ignoreInvalidArtifactDescriptor ); String getChecksumPolicy(); DefaultRepositorySystemSession setChecksumPolicy( String checksumPolicy ); String getUpdatePolicy(); DefaultRepositorySystemSession setUpdatePolicy( String updatePolicy ); LocalRepository getLocalRepository(); LocalRepositoryManager getLocalRepositoryManager(); DefaultRepositorySystemSession setLocalRepositoryManager( LocalRepositoryManager localRepositoryManager ); WorkspaceReader getWorkspaceReader(); DefaultRepositorySystemSession setWorkspaceReader( WorkspaceReader workspaceReader ); RepositoryListener getRepositoryListener(); DefaultRepositorySystemSession setRepositoryListener( RepositoryListener repositoryListener ); TransferListener getTransferListener(); DefaultRepositorySystemSession setTransferListener( TransferListener transferListener ); Map<String, String> getSystemProperties(); DefaultRepositorySystemSession setSystemProperties( Map<String, String> systemProperties ); DefaultRepositorySystemSession setSystemProps( Hashtable<?, ?> systemProperties ); DefaultRepositorySystemSession setSystemProperty( String key, String value ); Map<String, String> getUserProperties(); DefaultRepositorySystemSession setUserProperties( Map<String, String> userProperties ); DefaultRepositorySystemSession setUserProps( Map<?, ?> userProperties ); DefaultRepositorySystemSession setUserProperty( String key, String value ); Map<String, Object> getConfigProperties(); DefaultRepositorySystemSession setConfigProperties( Map<String, Object> configProperties ); DefaultRepositorySystemSession setConfigProps( Map<?, ?> configProperties ); DefaultRepositorySystemSession setConfigProperty( String key, Object value ); MirrorSelector getMirrorSelector(); DefaultRepositorySystemSession setMirrorSelector( MirrorSelector mirrorSelector ); ProxySelector getProxySelector(); DefaultRepositorySystemSession setProxySelector( ProxySelector proxySelector ); AuthenticationSelector getAuthenticationSelector(); DefaultRepositorySystemSession setAuthenticationSelector( AuthenticationSelector authenticationSelector ); ArtifactTypeRegistry getArtifactTypeRegistry(); DefaultRepositorySystemSession setArtifactTypeRegistry( ArtifactTypeRegistry artifactTypeRegistry ); DependencyTraverser getDependencyTraverser(); DefaultRepositorySystemSession setDependencyTraverser( DependencyTraverser dependencyTraverser ); DependencyManager getDependencyManager(); DefaultRepositorySystemSession setDependencyManager( DependencyManager dependencyManager ); DependencySelector getDependencySelector(); DefaultRepositorySystemSession setDependencySelector( DependencySelector dependencySelector ); DependencyGraphTransformer getDependencyGraphTransformer(); DefaultRepositorySystemSession setDependencyGraphTransformer( DependencyGraphTransformer dependencyGraphTransformer ); SessionData getData(); DefaultRepositorySystemSession setData( SessionData data ); RepositoryCache getCache(); DefaultRepositorySystemSession setCache( RepositoryCache cache );  }
@Test public void testDefaultAuthenticationSelectorUsesExistingAuth() { DefaultRepositorySystemSession session = new DefaultRepositorySystemSession(); RemoteRepository repo = new RemoteRepository( "id", "default", "void" ); assertSame( null, session.getAuthenticationSelector().getAuthentication( repo ) ); repo.setAuthentication( new Authentication( "user", "pass" ) ); assertSame( repo.getAuthentication(), session.getAuthenticationSelector().getAuthentication( repo ) ); }