Package com.github.restdriver.clientdriver

Examples of com.github.restdriver.clientdriver.ClientDriverResponse.withHeader()


    public void usingHeaderCanOverrideContentType() {
        ClientDriverResponse response = new ClientDriverResponse("hello").withContentType("text/plain");
       
        assertThat(response.getContentType(), is("text/plain"));
       
        response.withHeader("Content-Type", "text/xml");
       
        assertThat(response.getContentType(), is("text/xml"));
    }
   
    @SuppressWarnings("deprecation")
View Full Code Here


    public void usingHeaderCanOverrideContentTypeIgnoringCase() {
        ClientDriverResponse response = new ClientDriverResponse("hello").withContentType("text/plain");
       
        assertThat(response.getContentType(), is("text/plain"));
       
        response.withHeader("content-type", "text/xml");
       
        assertThat(response.getContentType(), is("text/xml"));
    }
   
    @Test
View Full Code Here

   
    @Test
    public void customHeadersCanBeSet() {
        ClientDriverResponse response = new ClientDriverResponse();
       
        response.withHeader("Server", "server-name");
       
        assertThat(response.getHeaders(), hasEntry("Server", "server-name"));
    }
   
}
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.