WebSSOProfileHoKConfigurer extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder> { @Override public void configure(ServiceProviderBuilder builder) throws Exception { if (hokProfileBean == null) { if (hokProfile == null) { hokProfile = createDefaultWebSSOProfileHoK(); } builder.setSharedObject(WebSSOProfileHoKImpl.class, hokProfile); } } WebSSOProfileHoKConfigurer();  WebSSOProfileHoKConfigurer(WebSSOProfileHoKImpl hokProfile); @Override void init(ServiceProviderBuilder builder); @Override void configure(ServiceProviderBuilder builder);  }
@Test public void configure() throws Exception { WebSSOProfileHoKConfigurer configurer = spy(new WebSSOProfileHoKConfigurer()); WebSSOProfileHoKImpl profile = mock(WebSSOProfileHoKImpl.class); when(configurer.createDefaultWebSSOProfileHoK()).thenReturn(profile); configurer.init(builder); configurer.configure(builder); verify(builder).setSharedObject(eq(WebSSOProfileHoKImpl.class), eq(profile)); }