Package com.pugh.sockso.web.action.api

Examples of com.pugh.sockso.web.action.api.ApiAction.canHandle()


        assertContains( res.getOutput(), "errorMessage" );
    }
   
    public void testErrorReturnedWhenActionRequiresLoginAndUserIsNotLoggedIn() throws Exception {
        ApiAction action = createNiceMock( ApiAction.class );
        expect( action.canHandle((Request)anyObject()) ).andReturn( Boolean.TRUE );
        expect( action.requiresLogin() ).andReturn( Boolean.TRUE );
        replay( action );
        //
        api.setUser( null );
        boolean gotException = false;
View Full Code Here


        verify( action );
    }
   
    public void testActionIsRunWhenUserNotLoggedInAndActionDoesNotRequireLogin() throws Exception {
        ApiAction action = createNiceMock( ApiAction.class );
        expect( action.canHandle((Request)anyObject()) ).andReturn( Boolean.TRUE );
        expect( action.requiresLogin() ).andReturn( Boolean.FALSE );
        action.handleRequest();
        replay( action );
        //
        api.setUser( null );
View Full Code Here

        verify( action );
    }
   
    public void testActionIsRunWhenActionRequiresLoginButServerDoesNot() throws Exception {
        ApiAction action = createNiceMock( ApiAction.class );
        expect( action.canHandle((Request)anyObject()) ).andReturn( Boolean.TRUE );
        action.handleRequest();
        replay( action );
        //
        p.set( Constants.WWW_USERS_REQUIRE_LOGIN, p.NO );
        api.setUser( null );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.