SecurityContextHolder.getContext().setAuthentication( auth );
}
public void setApplicationContext( final ApplicationContext applicationContext ) throws BeansException {
manager = (IBackingRepositoryLifecycleManager) applicationContext.getBean( "backingRepositoryLifecycleManager" );
SessionFactory jcrSessionFactory = (SessionFactory) applicationContext.getBean( "jcrSessionFactory" );
testJcrTemplate = new JcrTemplate( jcrSessionFactory );
testJcrTemplate.setAllowCreate( true );
testJcrTemplate.setExposeNativeSession( true );
repositoryAdminUsername = (String) applicationContext.getBean( "repositoryAdminUsername" );
authenticatedRoleName = (String) applicationContext.getBean( "singleTenantAuthenticatedAuthorityName" );