Package org.apache.airavata.services.registry.rest.security

Examples of org.apache.airavata.services.registry.rest.security.MyHttpServletRequest


        DerbyUtil.stopDerbyServer();
    }

    public void testAuthenticateSuccess() throws Exception {

        MyHttpServletRequest servletRequestRequest = new MyHttpServletRequest();
        servletRequestRequest.addHeader("sessionTicket", "1234");

        Assert.assertTrue(authenticator.authenticate(servletRequestRequest));

    }
View Full Code Here


    }

    public void testAuthenticateFail() throws Exception {

        MyHttpServletRequest servletRequestRequest = new MyHttpServletRequest();
        servletRequestRequest.addHeader("sessionTicket", "12345");

        Assert.assertFalse(authenticator.authenticate(servletRequestRequest));

    }
View Full Code Here

    }

    public void testCanProcess() throws Exception {

        MyHttpServletRequest servletRequestRequest = new MyHttpServletRequest();
        servletRequestRequest.addHeader("sessionTicket", "12345");

        Assert.assertTrue(authenticator.canProcess(servletRequestRequest));

    }
View Full Code Here

        Assert.assertTrue(authenticator.canProcess(getRequest("amilaj:secret")));
    }

    private MyHttpServletRequest getRequest(String userPassword) {
        MyHttpServletRequest myHttpServletRequest = new MyHttpServletRequest();

        String authHeader = "Basic " + new String(Base64.encodeBase64(userPassword.getBytes()));

        myHttpServletRequest.addHeader("Authorization", authHeader);
        myHttpServletRequest.addHeader(Constants.GATEWAY_NAME, "default");

        return myHttpServletRequest;

    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.services.registry.rest.security.MyHttpServletRequest

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.