Package org.webbitserver.stub

Examples of org.webbitserver.stub.StubHttpRequest.queryParam()


    private static final List<String> EMPTY = Collections.emptyList();

    @Test
    public void extractsSingleQueryParameter() throws Exception {
        HttpRequest req = new StubHttpRequest("http://host.com:8080/path?fish=cod&fruit=orange");
        assertEquals("cod", req.queryParam("fish"));
    }

    @Test
    public void extractsMultipleQueryParameters() throws Exception {
        HttpRequest req = new StubHttpRequest("http://host.com:8080/path?fish=cod&fruit=orange&fish=smørflyndre");
View Full Code Here


    @Test
    public void alwaysReturnsEmptyListWhenThereIsNoQueryString() throws Exception {
        HttpRequest req = new StubHttpRequest("http://host.com:8080/path");
        assertEquals(EMPTY, req.queryParams("fish"));
        assertNull(req.queryParam("fish"));
    }

    @Test
    public void returnsEmptyListWhenThereIsNoSuchParameter() throws Exception {
        HttpRequest req = new StubHttpRequest("http://host.com:8080/path?poisson=cabillaud");
View Full Code Here

    @Test
    public void returnsEmptyListWhenThereIsNoSuchParameter() throws Exception {
        HttpRequest req = new StubHttpRequest("http://host.com:8080/path?poisson=cabillaud");
        assertEquals(EMPTY, req.queryParams("fish"));
        assertNull(req.queryParam("fish"));
    }

}
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.