SingleLogoutProfileConfigurer extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder> { @Override public void configure(ServiceProviderBuilder builder) throws Exception { if (sloProfileBean == null) { if (sloProfile == null) { sloProfile = createDefaultSingleLogoutProfile(); } builder.setSharedObject(SingleLogoutProfile.class, sloProfile); } } SingleLogoutProfileConfigurer();  SingleLogoutProfileConfigurer(SingleLogoutProfile sloProfile); @Override void init(ServiceProviderBuilder builder); @Override void configure(ServiceProviderBuilder builder);  }
@Test public void configure() throws Exception { SingleLogoutProfileConfigurer configurer = spy(new SingleLogoutProfileConfigurer()); SingleLogoutProfile profile = mock(SingleLogoutProfile.class); when(configurer.createDefaultSingleLogoutProfile()).thenReturn(profile); configurer.init(builder); configurer.configure(builder); verify(builder).setSharedObject(eq(SingleLogoutProfile.class), eq(profile)); }