Package restx.server.simple.simple

Examples of restx.server.simple.simple.SimpleRestxRequest


* @author fcamblor
*/
public class CookiesTest {
    @Test
    public void shouldCookiesFetchedCorrectly() throws InterruptedException {
        SimpleRestxRequest restxRequest = createRestxRequest(new Cookie("foo", "valueWhenFound"));
        assertThat(restxRequest.getCookieValue("foo").or("valueWhenNotFound"), is(equalTo("valueWhenFound")));
        assertThat(restxRequest.getCookieValue("unexistingCookie").or("valueWhenNotFound"), is(equalTo("valueWhenNotFound")));
    }
View Full Code Here


        assertThat(restxRequest.getCookieValue("unexistingCookie").or("valueWhenNotFound"), is(equalTo("valueWhenNotFound")));
    }

    @Test
    public void shouldCookieExpirationBeCorrectlyCalculated() throws InterruptedException {
        SimpleRestxRequest restxRequest = createRestxRequest(
                persistentCookie("fastlyExpiredCookie", "fastlyExpiredCookieValue", 1),
                new Cookie("foo", "fooVal")
        );
        assertThat(restxRequest.isPersistentCookie("foo"), is(false));
        assertThat(restxRequest.isPersistentCookie("fastlyExpiredCookie"), is(true));
    }
View Full Code Here

        assertThat(restxRequest.isPersistentCookie("fastlyExpiredCookie"), is(true));
    }

    private static SimpleRestxRequest createRestxRequest(Cookie... cookies) {
        Request simpleRequest = createSimpleRequestMock(cookies);
        return new SimpleRestxRequest(Factory.getInstance().getComponent(HttpSettings.class),
                "/foo", simpleRequest);
    }
View Full Code Here

TOP

Related Classes of restx.server.simple.simple.SimpleRestxRequest

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.