Package com.github.restdriver.serverdriver.http.response

Examples of com.github.restdriver.serverdriver.http.response.Response


    public void postWithTextPlainBody() {
        driver.addExpectation(
                new ClientDriverRequest("/").withMethod(ClientDriverRequest.Method.PUT).withBody("Your body", "text/plain"),
                new ClientDriverResponse("Back at you", "text/plain").withStatus(202));
       
        Response response = put(baseUrl, body("Your body", "text/plain"));
       
        assertThat(response, hasStatusCode(202));
        assertThat(response.getContent(), is("Back at you"));
    }
View Full Code Here


                new ClientDriverRequest("/")
                        .withMethod(ClientDriverRequest.Method.PUT)
                        .withBody("<yo/>", "application/xml"),
                new ClientDriverResponse("Back at you", "text/plain").withStatus(202));
       
        Response response = put(baseUrl, body("<yo/>", "application/xml"));
       
        assertThat(response, hasStatusCode(202));
        assertThat(response.getContent(), is("Back at you"));
    }
View Full Code Here

                        .withMethod(ClientDriverRequest.Method.PUT)
                        .withBody("<yo/>", "application/xml")
                        .withHeader("Accept", "Nothing"),
                new ClientDriverResponse("Back at you", "text/plain").withStatus(202));
       
        Response response = put(baseUrl + "/jsons", body("<yo/>", "application/xml"), header("Accept", "Nothing"));
       
        assertThat(response, hasStatusCode(202));
        assertThat(response.getContent(), is("Back at you"));
    }
View Full Code Here

                new ClientDriverRequest("/xml")
                        .withMethod(ClientDriverRequest.Method.PUT)
                        .withBody("<yo/>", "application/xml"),
                new ClientDriverResponse("Back at you", "text/plain").withStatus(202));
       
        Response response = put(baseUrl + "/xml", body("{}", "application/json"), body("<yo/>", "application/xml"));
       
        assertThat(response, hasStatusCode(202));
        assertThat(response.getContent(), is("Back at you"));
    }
View Full Code Here

                new ClientDriverRequest("/bytes")
                        .withMethod(ClientDriverRequest.Method.PUT)
                        .withBody("some bytes", "application/pdf"),
                new ClientDriverResponse("The response", "text/plain").withStatus(418));
       
        Response response = put(baseUrl + "/bytes", body("some bytes".getBytes(), "application/pdf"));
       
        assertThat(response, hasStatusCode(418));
        assertThat(response.getContent(), is("The response"));
    }
View Full Code Here

    public void postEmptyBody() {
        driver.addExpectation(
                new ClientDriverRequest("/").withMethod(ClientDriverRequest.Method.POST),
                new ClientDriverResponse("Content", "text/plain"));
       
        Response response = post(baseUrl);
       
        assertThat(response, hasStatusCode(200));
        assertThat(response.getContent(), is("Content"));
    }
View Full Code Here

    public void postWithTextPlainBody() {
        driver.addExpectation(
                new ClientDriverRequest("/").withMethod(ClientDriverRequest.Method.POST).withBody("Your body", "text/plain"),
                new ClientDriverResponse("Back at you", "text/plain").withStatus(202));
       
        Response response = post(baseUrl, body("Your body", "text/plain"));
       
        assertThat(response, hasStatusCode(202));
        assertThat(response.getContent(), is("Back at you"));
    }
View Full Code Here

                new ClientDriverRequest("/")
                        .withMethod(ClientDriverRequest.Method.POST)
                        .withBody("<yo/>", "application/xml"),
                new ClientDriverResponse("Back at you", "text/plain").withStatus(202));
       
        Response response = post(baseUrl, body("<yo/>", "application/xml"));
       
        assertThat(response, hasStatusCode(202));
        assertThat(response.getContent(), is("Back at you"));
    }
View Full Code Here

                        .withMethod(ClientDriverRequest.Method.POST)
                        .withBody("<yo/>", "application/xml")
                        .withHeader("Accept", "Nothing"),
                new ClientDriverResponse("Back at you", "text/plain").withStatus(202));
       
        Response response = post(baseUrl + "/jsons", body("<yo/>", "application/xml"), header("Accept", "Nothing"));
       
        assertThat(response, hasStatusCode(202));
        assertThat(response.getContent(), is("Back at you"));
    }
View Full Code Here

                new ClientDriverRequest("/xml")
                        .withMethod(ClientDriverRequest.Method.POST)
                        .withBody("<yo/>", "application/xml"),
                new ClientDriverResponse("Back at you", "text/plain").withStatus(202));
       
        Response response = post(baseUrl + "/xml", body("{}", "application/json"), body("<yo/>", "application/xml"));
       
        assertThat(response, hasStatusCode(202));
        assertThat(response.getContent(), is("Back at you"));
    }
View Full Code Here

TOP

Related Classes of com.github.restdriver.serverdriver.http.response.Response

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.