Package in.partake.controller

Examples of in.partake.controller.ActionProxy.execute()


    @Test
    public void testToSetPreferenceWithoutLogin() throws Exception {
        ActionProxy proxy = getActionProxy(POST, "/api/account/setPreference");

        proxy.execute();
        assertResultLoginRequired(proxy);
    }
}
View Full Code Here


    @Test
    public void testToGetSessionTokenWithoutLogin() throws Exception {
        // Even if not logged in, the token session should be available.
        ActionProxy proxy = getActionProxy(GET, SESSION_TOKEN_PATH);

        proxy.execute();
        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);
        Assert.assertTrue(obj.has("token"));
    }
View Full Code Here

        // If logged in, the token session should be available also.
        ActionProxy proxy = getActionProxy(GET, SESSION_TOKEN_PATH);

        loginAs(proxy, TestDataProvider.DEFAULT_USER_ID);

        proxy.execute();
        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);
        Assert.assertTrue(obj.has("token"));
    }
View Full Code Here

        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", DEFAULT_EVENT_ID);
        addFormParameter(proxy, "title", "modified");

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

    @Test
    public void testToModifyWithInvalidSessionToken() throws Exception {
View Full Code Here

        loginAs(proxy, EVENT_OWNER_ID);
        addInvalidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", DEFAULT_EVENT_ID);
        addFormParameter(proxy, "title", "modified");

        proxy.execute();
        assertResultInvalid(proxy, UserErrorCode.INVALID_SECURITY_CSRF);
    }

    @Test
    public void testToModifyWithInvalidEventId1() throws Exception {
View Full Code Here

        loginAs(proxy, EVENT_OWNER_ID);
        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", INVALID_EVENT_ID);
        addFormParameter(proxy, "title", "modified");

        proxy.execute();
        assertResultInvalid(proxy, UserErrorCode.INVALID_EVENT_ID);
    }

    @Test
    public void testToModifyWithInvalidEventId2() throws Exception {
View Full Code Here

        prepareEnrollment(DEFAULT_USER_ID, ids);

        ActionProxy proxy = getActionProxy(GET, "/api/account/tickets?limit=10");
        loginAs(proxy, DEFAULT_USER_ID);

        proxy.execute();
        assertResultOK(proxy);

        ObjectNode obj = getJSON(proxy);
        assertThat(obj.get("totalTicketCount").asInt(), is(20));
View Full Code Here

        loginAs(proxy, EVENT_OWNER_ID);
        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", "non-uuid");
        addFormParameter(proxy, "title", "modified");

        proxy.execute();
        assertResultInvalid(proxy, UserErrorCode.INVALID_EVENT_ID);
    }

    // --- title
View Full Code Here

        loginAs(proxy, EVENT_OWNER_ID);
        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", DEFAULT_EVENT_ID);
        addFormParameter(proxy, "title", "modified");

        proxy.execute();
        assertResultOK(proxy);

        Event modified = loadEvent(DEFAULT_EVENT_ID);
        assertThat(modified.getTitle(), is("modified"));
    }
View Full Code Here

        loginAs(proxy, EVENT_OWNER_ID);
        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", DEFAULT_EVENT_ID);
        addFormParameter(proxy, "title", "");

        proxy.execute();
        assertResultInvalid(proxy, UserErrorCode.INVALID_PARAMETERS, "title");
    }

    @Test
    public void testToModifyTitleTooLong() throws Exception {
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.