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

Examples of com.github.restdriver.serverdriver.http.response.Response.asXml()


                new ClientDriverResponse("<some><content type='awesome'/></some>", "text/xml"));
       
        Response response = get(baseUrl);
       
        assertThat(response, hasStatusCode(200));
        assertThat(response.asXml(), hasXPath("/some/content/@type", is("awesome")));
    }
   
    @Test
    public void xPathCanBeRunOnTextResponse() {
       
View Full Code Here


        when(mockEntity.getContent()).thenReturn(IOUtils.toInputStream("This is not really xml, is it?", "utf-8"));
        HttpResponse mockResponse = createMockResponse(mockEntity);
        Response response = new DefaultResponse(mockResponse, 12345);
       
        try {
            response.asXml();
            Assert.fail();
           
        } catch (RuntimeXmlParseException rxpe) {
            assertThat(rxpe.getMessage(), is("Can't parse XML.  Bad content >> This is not real..."));
           
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.