Package in.partake.controller

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


public class AllCalendarTest extends ActionControllerTest {

    @Test
    public void testCalendar() throws Exception {
        ActionProxy proxy = getActionProxy(GET, "/calendars/all");
        proxy.execute();

        assertThat(Helpers.contentType(proxy.getResult()), is("text/calendar"));
        assertThat(Helpers.charset(proxy.getResult()), is("utf-8"));
        assertThat(Helpers.header("Content-Disposition", proxy.getResult()), is("inline"));
View Full Code Here


        loginAs(proxy, TestDataProvider.DEFAULT_USER_ID);
        addFormParameter(proxy, "identifier", TestDataProvider.DEFAULT_USER_OPENID_IDENTIFIER);
        addValidSessionTokenToParameter(proxy);

        proxy.execute();
        assertResultOK(proxy);

        // Check the OpenID has been really removed.
        List<UserOpenIDLink> links = loadOpenIDIdentifiers(DEFAULT_USER_ID);
        Assert.assertNotNull(links);
View Full Code Here

        ActionProxy proxy = getActionProxy(POST, "/api/account/removeOpenID");

        loginAs(proxy, TestDataProvider.DEFAULT_USER_ID);
        addValidSessionTokenToParameter(proxy);

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

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

        // When not login, should fail.
        addFormParameter(proxy, "identifier", TestDataProvider.DEFAULT_USER_OPENID_IDENTIFIER);
        addValidSessionTokenToParameter(proxy);

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

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

        loginAs(proxy, TestDataProvider.DEFAULT_ANOTHER_USER_ID);

        addFormParameter(proxy, "identifier", TestDataProvider.DEFAULT_USER_OPENID_IDENTIFIER);
        addValidSessionTokenToParameter(proxy);

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

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

        loginAs(proxy, TestDataProvider.DEFAULT_USER_ID);

        addFormParameter(proxy, "identifier", TestDataProvider.DEFAULT_USER_OPENID_IDENTIFIER);
        addInvalidSessionTokenToParameter(proxy);

        proxy.execute();
        assertResultInvalid(proxy, UserErrorCode.INVALID_SECURITY_CSRF);
    }
}
View Full Code Here

        addValidSessionTokenToParameter(proxy);
        addParameter(proxy, "profilePublic", "false");
        addParameter(proxy, "receivingTwitterMessage", "false");
        addParameter(proxy, "tweetingAttendanceAutomatically", "false");
        proxy.execute();

        assertResultOK(proxy);

        pref = loadUserPreference(TestDataProvider.DEFAULT_USER_ID);
        Assert.assertEquals(false, pref.isProfilePublic());
View Full Code Here

        addValidSessionTokenToParameter(proxy);
        addParameter(proxy, "profilePublic", "false");
        addParameter(proxy, "receivingTwitterMessage", "false");
        addParameter(proxy, "tweetingAttendanceAutomatically", "false");
        proxy.execute();

        assertResultOK(proxy);

        UserPreference pref = loadUserPreference(TestDataProvider.USER_WITHOUT_PREF_ID);
        Assert.assertEquals(false, pref.isProfilePublic());
View Full Code Here

        Assert.assertEquals(true, pref.isReceivingTwitterMessage());
        Assert.assertEquals(false, pref.tweetsAttendanceAutomatically());

        loginAs(proxy, TestDataProvider.DEFAULT_USER_ID);
        addValidSessionTokenToParameter(proxy);
        proxy.execute();

        assertResultOK(proxy);

        pref = loadUserPreference(TestDataProvider.DEFAULT_USER_ID);
        Assert.assertEquals(true, pref.isProfilePublic());
View Full Code Here

        ActionProxy proxy = getActionProxy(POST, "/api/account/setPreference");

        loginAs(proxy, TestDataProvider.DEFAULT_USER_ID);
        addInvalidSessionTokenToParameter(proxy);

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

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