Examples of payloadJsonAs()


Examples of org.doctester.testbrowser.Response.payloadJsonAs()

                                .url(testServerUrl().path("/_non_existing_url"))
                                .addHeader(HttpConstants.HEADER_ACCEPT, HttpConstants.APPLICATION_JSON));

    assertEquals(404, response.httpStatus);
       
    Message message = response.payloadJsonAs(Message.class);
        Assert.assertThat(message.text, CoreMatchers.equalTo(NinjaConstant.I18N_NINJA_SYSTEM_NOT_FOUND_TEXT_DEFAULT));

  }
   
    @Test
View Full Code Here

Examples of org.doctester.testbrowser.Response.payloadJsonAs()

        Response response = makeRequest(
                Request.GET().url(
                        testServerUrl().path(URL_HELLO_WORLD_JSON)));

        ApplicationController.SimplePojo simplePojo
                = response.payloadJsonAs(ApplicationController.SimplePojo.class);
       
        assertThat(simplePojo.content, CoreMatchers.equalTo("Hello World! Hello Json!"));

   
    }
View Full Code Here

Examples of org.doctester.testbrowser.Response.payloadJsonAs()

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