WebSSOProfileHoKConsumerConfigurer extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder> { @Override public void configure(ServiceProviderBuilder builder) throws Exception { if (hokProfileConsumerBean == null) { if (hokProfileConsumer == null) { hokProfileConsumer = createDefaultWebSSOProfileConsumerHoK(); } builder.setSharedObject(WebSSOProfileConsumerHoKImpl.class, hokProfileConsumer); } } WebSSOProfileHoKConsumerConfigurer();  WebSSOProfileHoKConsumerConfigurer(WebSSOProfileConsumerHoKImpl hokProfileConsumer); @Override void init(ServiceProviderBuilder builder); @Override void configure(ServiceProviderBuilder builder);  }
@Test public void configure() throws Exception { WebSSOProfileHoKConsumerConfigurer configurer = spy(new WebSSOProfileHoKConsumerConfigurer()); WebSSOProfileConsumerHoKImpl profile = mock(WebSSOProfileConsumerHoKImpl.class); when(configurer.createDefaultWebSSOProfileConsumerHoK()).thenReturn(profile); configurer.init(builder); configurer.configure(builder); verify(builder).setSharedObject(eq(WebSSOProfileConsumerHoKImpl.class), eq(profile)); }