protected Object lookupBean(String name) throws NoSuchBeanDefinitionException { Object bean = GeoServerExtensions.bean(name, manager.getApplicationContext()); if (bean == null) { throw new NoSuchBeanDefinitionException(name); } return bean; }
expect(secMgr.getApplicationContext()).andReturn(appContext).anyTimes();
public OAuth2AccessTokenURLMangler( GeoServerSecurityManager securityManager, GeoServerOAuth2SecurityConfiguration oauth2SecurityConfiguration, OAuth2RestTemplate geoServerOauth2RestTemplate) { assert securityManager != null; context = securityManager.getApplicationContext(); assert context != null; this.oauth2SecurityConfiguration = oauth2SecurityConfiguration; this.geoServerOauth2RestTemplate = geoServerOauth2RestTemplate; }
public OAuth2AccessTokenURLMangler( GeoServerSecurityManager securityManager, String oauth2SecurityConfiguration, String geoServerOauth2RestTemplate) { assert securityManager != null; context = securityManager.getApplicationContext(); assert context != null; this.oauth2SecurityConfiguration = (GeoServerOAuth2SecurityConfiguration) context.getBean(oauth2SecurityConfiguration); this.geoServerOauth2RestTemplate = (OAuth2RestTemplate) context.getBean(geoServerOauth2RestTemplate); }
public GeoServerOAuthAuthenticationProvider( GeoServerSecurityManager securityManager, String tokenServices, String oauth2SecurityConfiguration, String geoServerOauth2RestTemplate) { assert securityManager != null; context = securityManager.getApplicationContext(); assert context != null; this.tokenServices = (RemoteTokenServices) context.getBean(tokenServices); this.oauth2SecurityConfiguration = (GeoServerOAuth2SecurityConfiguration) context.getBean(oauth2SecurityConfiguration); this.geoServerOauth2RestTemplate = (OAuth2RestTemplate) context.getBean(geoServerOauth2RestTemplate); securityManager.addListener(this); }