Package in.partake.controller

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


        ActionProxy proxy = getActionProxy(POST, "/api/event/modify");
        loginAs(proxy, EVENT_OWNER_ID);
        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", DEFAULT_EVENT_ID);
        addFormParameter(proxy, "endDate", newEndDate.toHumanReadableFormat());
        proxy.execute();
        assertResultOK(proxy);

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


        loginAs(proxy, EVENT_OWNER_ID);
        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", DEFAULT_EVENT_ID);
        addFormParameter(proxy, "endDate", String.valueOf(tomorrow.getTime()));

        proxy.execute();
        assertResultOK(proxy);

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

        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", TestDataProvider.DEFAULT_EVENT_ID);
        addFormParameter(proxy, "comment", "comment");

        proxy.execute();
        assertResultOK(proxy);
    }

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

        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", TestDataProvider.DEFAULT_EVENT_ID);
        addFormParameter(proxy, "comment", "comment");

        proxy.execute();
        assertResultOK(proxy);
    }

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

        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", TestDataProvider.DEFAULT_EVENT_ID);
        addFormParameter(proxy, "comment", "comment");

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

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

        addInvalidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", TestDataProvider.DEFAULT_EVENT_ID);
        addFormParameter(proxy, "comment", "comment");

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

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

        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", TestDataProvider.INVALID_EVENT_ID);
        addFormParameter(proxy, "comment", "comment");

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

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

        loginAs(proxy, TestDataProvider.EVENT_OWNER_ID);

        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "comment", "comment");

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

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

        loginAs(proxy, TestDataProvider.EVENT_OWNER_ID);

        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", TestDataProvider.DEFAULT_EVENT_ID);

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

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

        addValidSessionTokenToParameter(proxy);
        addFormParameter(proxy, "eventId", TestDataProvider.DEFAULT_EVENT_ID);
        addFormParameter(proxy, "comment", "");

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

    @Test
    public void testToCommentWithBlankComment() 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.