Package org.doctester.testbrowser

Examples of org.doctester.testbrowser.Response


public class AsyncTest extends NinjaDocTester {

    @Test
    public void testThatAsyncWorks() {

        Response response = makeRequest(Request.GET().url(testServerUrl().path("async")));
       
        Assert.assertThat(response.httpStatus, CoreMatchers.equalTo(200));
        Assert.assertTrue(response.payload.contains("Async works!"));

View Full Code Here


   
   
    @Test
    public void testThatErrorHandlingWorksHtml() {

        Response response = makeRequest(Request.GET().url(testServerUrl().path("throw_exception")));
        Assert.assertThat(response.httpStatus, CoreMatchers.equalTo(400));
        Assert.assertTrue(response.payload.contains("Oops. That's a bad request and all we know."));

    }
View Full Code Here

    }
   
    @Test
    public void testThatErrorHandlingWorksJson() {

        Response response = makeRequest(
                Request.GET().addHeader("ACCEPT", "application/json")
                        .url(testServerUrl().path("throw_exception")));

        Assert.assertThat(response.httpStatus, CoreMatchers.equalTo(400));
        Message message = response.payloadJsonAs(Message.class);
        Assert.assertThat(message.text, CoreMatchers.equalTo("Oops. That's a bad request and all we know."));

    }
View Full Code Here


    @Test
    public void testIndex() {

        Response response = makeRequest(
                Request.GET().url(testServerUrl().path("/index")));
       
        Assert.assertThat(response.payload, CoreMatchers.equalTo("works."));

    }
View Full Code Here

       
        sayNextSection("Retrieving articles for a user (Json)");
       
        say("Retrieving all articles of a user is a GET request to " + GET_ARTICLES_URL);
       
        Response response = sayAndMakeRequest(
                Request.GET().url(
                        testServerUrl().path(GET_ARTICLES_URL.replace("{username}", "bob@gmail.com"))));

        ArticlesDto articlesDto = getGsonWithLongToDateParsing().fromJson(response.payload, ArticlesDto.class);
View Full Code Here

TOP

Related Classes of org.doctester.testbrowser.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.