Code example for ProtocolVersion

0
    protected Context getContext() {
        return getInstrumentation().getContext();
    } 
 
    public PersitingActorTestCase<T> given(InputStream in) {
        httpResponse = new BasicHttpResponse(new BasicStatusLine(new ProtocolVersion("http", 1, 1),
                200, "OK")); 
        InputStreamEntity entity = new InputStreamEntity(in, -1);
        httpResponse.setEntity(entity);
        return this;
    } 
 
    public PersitingActorTestCase<T> given(String httpResponseBody) {
        httpResponse = new BasicHttpResponse(new BasicStatusLine(new ProtocolVersion("http", 1, 1),
                200, "OK")); 
        StringEntity entity = null;
        try { 
            entity = new StringEntity(httpResponseBody);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }