Package org.apache.sling.replication.transport.authentication

Examples of org.apache.sling.replication.transport.authentication.TransportAuthenticationContext


    @Test
    public void testAuthenticationWithAuthenticableAndEmptyContext() throws Exception {
        UserCredentialsTransportAuthenticationProvider authenticationHandler = new UserCredentialsTransportAuthenticationProvider(
                "foo", "bar");
        Executor authenticable = Executor.newInstance();
        TransportAuthenticationContext context = new TransportAuthenticationContext();
        try {
            authenticationHandler.authenticate(authenticable, context);
            fail("could not authenticate with an empty context");
        } catch (Exception e) {
            // expected to fail
View Full Code Here


    @Test
    public void testAuthenticationWithAuthenticableAndCorrectContext() throws Exception {
        UserCredentialsTransportAuthenticationProvider authenticationHandler = new UserCredentialsTransportAuthenticationProvider(
                "foo", "bar");
        Executor authenticable = Executor.newInstance();
        TransportAuthenticationContext context = new TransportAuthenticationContext();
        context.addAttribute("endpoint", new ReplicationEndpoint("http://www.apache.org"));
        authenticationHandler.authenticate(authenticable, context);
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.replication.transport.authentication.TransportAuthenticationContext

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.