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

Examples of com.pugh.sockso.web.action.api.ApiAction


        api.handleRequest();
        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;
        try {
View Full Code Here


        if ( !gotException ) { fail( "Expecting exception to be thrown as user was not logged in" ); }
        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 );
        api.processActions( new ApiAction[] { action } );
        verify( action );
View Full Code Here

        api.processActions( new ApiAction[] { action } );
        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 );
        api.processActions( new ApiAction[] { action } );
View Full Code Here

TOP

Related Classes of com.pugh.sockso.web.action.api.ApiAction

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.