Package waffle.mock

Examples of waffle.mock.MockWindowsAuthProvider


public class TestProvider implements SecurityFilterProvider {

  private MockWindowsAuthProvider _auth = null;

  public TestProvider(final IWindowsAuthProvider auth) {
    _auth = new MockWindowsAuthProvider();
    // System.out.println("ctor()");

  }
View Full Code Here


    private MockWindowsAuthProvider windowsAuthProvider;
    private GroupMappingWaffleRealm realm;

    @Before
    public void setUp() {
        this.windowsAuthProvider = new MockWindowsAuthProvider();
        this.realm = new GroupMappingWaffleRealm();
        this.realm.setProvider(this.windowsAuthProvider);
        this.realm.setGroupRolesMap(Collections.singletonMap("Users", ROLE_NAME));
    }
View Full Code Here

    private NegotiateSecurityFilter filter;

    @Before
    public void setUp() throws ServletException {
        this.filter = new NegotiateSecurityFilter();
        this.filter.setAuth(new MockWindowsAuthProvider());
        this.filter.init(null);
    }
View Full Code Here

    WindowsLoginModule      loginModule;
    MockWindowsAuthProvider provider;

    @Before
    public void setUp() {
        this.provider = new MockWindowsAuthProvider();
        this.loginModule = new WindowsLoginModule();
        this.loginModule.setAuth(this.provider);
    }
View Full Code Here

        Assert.assertEquals(1, response.getHeaderNames().size());
    }

    @Test
    public void testProgrammaticSecurity() throws ServletException {
        this.authenticator.setAuth(new MockWindowsAuthProvider());
        final SimpleHttpRequest request = new SimpleHttpRequest();
        request.setContext((Context) this.authenticator.getContainer());

        request.login(WindowsAccountImpl.getCurrentUsername(), "");
View Full Code Here

        Assert.assertTrue(windowsPrincipal.getSidString().startsWith("S-"));
    }

    @Test
    public void testSecurityCheckParameters() {
        this.authenticator.setAuth(new MockWindowsAuthProvider());
        final LoginConfig loginConfig = new LoginConfig();
        loginConfig.setErrorPage("error.html");
        loginConfig.setLoginPage("login.html");
        final SimpleHttpRequest request = new SimpleHttpRequest();
        request.addParameter("j_security_check", "");
View Full Code Here

        Assert.assertTrue(this.authenticator.authenticate(request, response, loginConfig));
    }

    @Test
    public void testSecurityCheckQueryString() {
        this.authenticator.setAuth(new MockWindowsAuthProvider());
        final LoginConfig loginConfig = new LoginConfig();
        loginConfig.setErrorPage("error.html");
        loginConfig.setLoginPage("login.html");
        final SimpleHttpRequest request = new SimpleHttpRequest();
        request.setQueryString("j_security_check");
View Full Code Here

        Assert.assertEquals(1, response.getHeaderNames().size());
    }

    @Test
    public void testProgrammaticSecurity() throws ServletException {
        this.authenticator.setAuth(new MockWindowsAuthProvider());
        final SimpleHttpRequest request = new SimpleHttpRequest();
        request.getMappingData().context = (Context) this.authenticator.getContainer();

        request.login(WindowsAccountImpl.getCurrentUsername(), "");
View Full Code Here

        Assert.assertTrue(windowsPrincipal.getSidString().startsWith("S-"));
    }

    @Test
    public void testSecurityCheckParameters() {
        this.authenticator.setAuth(new MockWindowsAuthProvider());
        final SimpleHttpRequest request = new SimpleHttpRequest();
        request.addParameter("j_security_check", "");
        request.addParameter("j_username", WindowsAccountImpl.getCurrentUsername());
        request.addParameter("j_password", "");
        final SimpleHttpResponse response = new SimpleHttpResponse();
View Full Code Here

        Assert.assertTrue(this.authenticator.authenticate(request, response));
    }

    @Test
    public void testSecurityCheckQueryString() {
        this.authenticator.setAuth(new MockWindowsAuthProvider());
        final SimpleHttpRequest request = new SimpleHttpRequest();
        request.setQueryString("j_security_check");
        request.addParameter("j_username", WindowsAccountImpl.getCurrentUsername());
        request.addParameter("j_password", "");
        final SimpleHttpResponse response = new SimpleHttpResponse();
View Full Code Here

TOP

Related Classes of waffle.mock.MockWindowsAuthProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.