Package in.partake.controller.action.admin

Source Code of in.partake.controller.action.admin.AdminPageActionTest

package in.partake.controller.action.admin;

import in.partake.controller.ActionProxy;
import in.partake.controller.action.ActionControllerTest;

import org.junit.Test;

public class AdminPageActionTest extends ActionControllerTest {

    @Test
    public void testWithAdminLogin() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/admin");
        loginAs(proxy, ADMIN_USER_ID);

        proxy.execute();
        assertResultSuccess(proxy);
    }

    @Test
    public void testWithLogin() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/admin");
        loginAs(proxy, DEFAULT_USER_ID);

        proxy.execute();
        assertResultForbidden(proxy);
    }

    @Test
    public void testWithoutLogin() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/admin");

        proxy.execute();
        assertResultLoginRequired(proxy);
    }
}
TOP

Related Classes of in.partake.controller.action.admin.AdminPageActionTest

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.