Search in sources :

Example 1 with RequestParameterAuthenticationFilter

use of org.pentaho.platform.web.http.security.RequestParameterAuthenticationFilter in project pentaho-platform by pentaho.

the class RequestParameterAuthenticationFilterTest method beforeTest.

@Before
public void beforeTest() throws KettleException, IOException {
    KettleClientEnvironment.init();
    filter = new RequestParameterAuthenticationFilter();
    authManagerMock = mock(AuthenticationManager.class);
    filter.setAuthenticationManager(authManagerMock);
    final Properties properties = new Properties();
    properties.setProperty("requestParameterAuthenticationEnabled", "true");
    IConfiguration config = mock(IConfiguration.class);
    ISystemConfig mockISystemConfig = mock(ISystemConfig.class);
    mockISystemConfig.registerConfiguration(config);
    filter.setSystemConfig(mockISystemConfig);
    doReturn(config).when(mockISystemConfig).getConfiguration("security");
    doReturn(properties).when(config).getProperties();
}
Also used : AuthenticationManager(org.springframework.security.authentication.AuthenticationManager) ISystemConfig(org.pentaho.platform.api.engine.ISystemConfig) Properties(java.util.Properties) IConfiguration(org.pentaho.platform.api.engine.IConfiguration) RequestParameterAuthenticationFilter(org.pentaho.platform.web.http.security.RequestParameterAuthenticationFilter) Before(org.junit.Before)

Aggregations

Properties (java.util.Properties)1 Before (org.junit.Before)1 IConfiguration (org.pentaho.platform.api.engine.IConfiguration)1 ISystemConfig (org.pentaho.platform.api.engine.ISystemConfig)1 RequestParameterAuthenticationFilter (org.pentaho.platform.web.http.security.RequestParameterAuthenticationFilter)1 AuthenticationManager (org.springframework.security.authentication.AuthenticationManager)1