WebSSOProfileConfigurer extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder> { @Override public void configure(ServiceProviderBuilder builder) throws Exception { if (webSSOProfileBean == null) { if (webSSOProfile == null) { webSSOProfile = createDefaultWebSSOProfile(); } builder.setSharedObject(WebSSOProfile.class, webSSOProfile); } } WebSSOProfileConfigurer();  WebSSOProfileConfigurer(WebSSOProfile webSSOProfile); @Override void init(ServiceProviderBuilder builder); @Override void configure(ServiceProviderBuilder builder);  }
@Test public void configure() throws Exception { WebSSOProfileConfigurer configurer = spy(new WebSSOProfileConfigurer()); WebSSOProfile profile = mock(WebSSOProfile.class); when(configurer.createDefaultWebSSOProfile()).thenReturn(profile); configurer.init(builder); configurer.configure(builder); verify(builder).setSharedObject(eq(WebSSOProfile.class), eq(profile)); }