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

Examples of com.github.restdriver.serverdriver.http.response.DefaultResponse.asBytes()


        when(mockEntity.getContent()).thenReturn(new ByteArrayInputStream(bytes));
        HttpResponse mockResponse = createMockResponse(mockEntity);
       
        Response response = new DefaultResponse(mockResponse, 12345);
       
        assertThat(response.asBytes(), is(bytes));
        assertThat(response.asText(), is("Jeff"));
    }
   
    @Test
    public void asJsonErrorGivesClearMessage() throws IOException {
View Full Code Here


        when(mockEntity.getContent()).thenReturn(new ByteArrayInputStream(bytes));
        HttpResponse mockResponse = createMockResponse(mockEntity);
       
        Response response = new DefaultResponse(mockResponse, 12345);
       
        assertThat(response.asBytes(), is(bytes));
    }
   
    @Test
    public void stringAndBytesWorkTogether() throws Exception {
       
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.