@Test public void testGetLoginCtxProviderWhiteboard() throws Exception { Whiteboard wb = new DefaultWhiteboard(); SecurityProvider sp = mock(SecurityProvider.class, Mockito.withSettings().extraInterfaces(WhiteboardAware.class)); when(((WhiteboardAware) sp).getWhiteboard()).thenReturn(wb); authConfiguration.setSecurityProvider(sp); LoginContextProvider lcp = authConfiguration.getLoginContextProvider(repo); assertTrue(lcp instanceof LoginContextProviderImpl); Field f = LoginContextProviderImpl.class.getDeclaredField("whiteboard"); f.setAccessible(true); assertSame(wb, f.get(lcp)); }
@NotNull @Override public LoginContextProvider getLoginContextProvider(@NotNull ContentRepository contentRepository) { String appName = getParameters().getConfigValue(PARAM_APP_NAME, DEFAULT_APP_NAME); SecurityProvider provider = getSecurityProvider(); Whiteboard whiteboard = null; if (provider instanceof WhiteboardAware) { whiteboard = ((WhiteboardAware) provider).getWhiteboard(); } else { log.warn("Unable to obtain whiteboard from SecurityProvider"); } return new LoginContextProviderImpl(appName, getParameters(), contentRepository, provider, whiteboard, lmMonitor); }
AuthenticationConfigurationImpl extends ConfigurationBase implements AuthenticationConfiguration, LoginModuleStatsCollector { @NotNull @Override public LoginContextProvider getLoginContextProvider(@NotNull ContentRepository contentRepository) { String appName = getParameters().getConfigValue(PARAM_APP_NAME, DEFAULT_APP_NAME); SecurityProvider provider = getSecurityProvider(); Whiteboard whiteboard = null; if (provider instanceof WhiteboardAware) { whiteboard = ((WhiteboardAware) provider).getWhiteboard(); } else { log.warn("Unable to obtain whiteboard from SecurityProvider"); } return new LoginContextProviderImpl(appName, getParameters(), contentRepository, provider, whiteboard, lmMonitor); } }
AuthenticationConfigurationImpl extends ConfigurationBase implements AuthenticationConfiguration, LoginModuleStatsCollector { @NotNull @Override public LoginContextProvider getLoginContextProvider(@NotNull ContentRepository contentRepository) { String appName = getParameters().getConfigValue(PARAM_APP_NAME, DEFAULT_APP_NAME); SecurityProvider provider = getSecurityProvider(); Whiteboard whiteboard = null; if (provider instanceof WhiteboardAware) { whiteboard = ((WhiteboardAware) provider).getWhiteboard(); } else { log.warn("Unable to obtain whiteboard from SecurityProvider"); } return new LoginContextProviderImpl(appName, getParameters(), contentRepository, provider, whiteboard, lmMonitor); } @SuppressWarnings("UnusedDeclaration")  AuthenticationConfigurationImpl();  AuthenticationConfigurationImpl(SecurityProvider securityProvider); }
AuthenticationConfigurationImpl extends ConfigurationBase implements AuthenticationConfiguration, LoginModuleStatsCollector { @NotNull @Override public LoginContextProvider getLoginContextProvider(@NotNull ContentRepository contentRepository) { String appName = getParameters().getConfigValue(PARAM_APP_NAME, DEFAULT_APP_NAME); SecurityProvider provider = getSecurityProvider(); Whiteboard whiteboard = null; if (provider instanceof WhiteboardAware) { whiteboard = ((WhiteboardAware) provider).getWhiteboard(); } else { log.warn("Unable to obtain whiteboard from SecurityProvider"); } return new LoginContextProviderImpl(appName, getParameters(), contentRepository, provider, whiteboard, lmMonitor); } @SuppressWarnings("UnusedDeclaration")  AuthenticationConfigurationImpl();  AuthenticationConfigurationImpl(SecurityProvider securityProvider); @NotNull @Override String getName(); @NotNull @Override LoginContextProvider getLoginContextProvider(@NotNull ContentRepository contentRepository); @Override void setLoginModuleMonitor(@NotNull LoginModuleMonitor lmMonitor); }
AuthenticationConfigurationImpl extends ConfigurationBase implements AuthenticationConfiguration, LoginModuleStatsCollector { @NotNull @Override public LoginContextProvider getLoginContextProvider(@NotNull ContentRepository contentRepository) { String appName = getParameters().getConfigValue(PARAM_APP_NAME, DEFAULT_APP_NAME); SecurityProvider provider = getSecurityProvider(); Whiteboard whiteboard = null; if (provider instanceof WhiteboardAware) { whiteboard = ((WhiteboardAware) provider).getWhiteboard(); } else { log.warn("Unable to obtain whiteboard from SecurityProvider"); } return new LoginContextProviderImpl(appName, getParameters(), contentRepository, provider, whiteboard, lmMonitor); } @SuppressWarnings("UnusedDeclaration")  AuthenticationConfigurationImpl();  AuthenticationConfigurationImpl(SecurityProvider securityProvider); @NotNull @Override String getName(); @NotNull @Override LoginContextProvider getLoginContextProvider(@NotNull ContentRepository contentRepository); @Override void setLoginModuleMonitor(@NotNull LoginModuleMonitor lmMonitor);  }