Search in sources :

Example 1 with HttpResponseImpl

use of com.openmeap.http.HttpResponseImpl in project OpenMEAP by OpenMEAP.

the class MockHttpRequestExecuter method putTogetherResponse.

private HttpResponse putTogetherResponse() throws HttpRequestException {
    try {
        HttpResponseImpl response = new HttpResponseImpl();
        response.setContentLength(responseText.length());
        response.setStatusCode(responseCode);
        response.setResponseBody(new ByteArrayInputStream(responseText.getBytes()));
        return response;
    } catch (Exception e) {
        throw new HttpRequestException(e);
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) HttpRequestException(com.openmeap.http.HttpRequestException) HttpResponseImpl(com.openmeap.http.HttpResponseImpl) HttpRequestException(com.openmeap.http.HttpRequestException)

Aggregations

HttpRequestException (com.openmeap.http.HttpRequestException)1 HttpResponseImpl (com.openmeap.http.HttpResponseImpl)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1