WebSSOProfileECPConfigurer extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder> { @Override public void configure(ServiceProviderBuilder builder) throws Exception { if (ecpProfileBean == null) { if (ecpProfile == null) { ecpProfile = createDefaultWebSSOProfileECP(); } builder.setSharedObject(WebSSOProfileECPImpl.class, ecpProfile); } } WebSSOProfileECPConfigurer();  WebSSOProfileECPConfigurer(WebSSOProfileECPImpl ecpProfile); @Override void init(ServiceProviderBuilder builder); @Override void configure(ServiceProviderBuilder builder);  }
@Test public void configure() throws Exception { WebSSOProfileECPConfigurer configurer = spy(new WebSSOProfileECPConfigurer()); WebSSOProfileECPImpl profile = mock(WebSSOProfileECPImpl.class); when(configurer.createDefaultWebSSOProfileECP()).thenReturn(profile); configurer.init(builder); configurer.configure(builder); verify(builder).setSharedObject(eq(WebSSOProfileECPImpl.class), eq(profile)); }