@Test
public void getEncoding() throws Exception {

    {
        HttpRequestMethod httpRequestMethod = HttpRequestMethod.GET;
        String url = "http://example.com";
        String encoding = "utf-8";
        HttpParameter[] parameters = new HttpParameter[]{new HttpParameter("key", "value")};
        HttpRequest httpRequest = new HttpRequest(httpRequestMethod, url, encoding, parameters);
        assertThat(httpRequest.getEncoding(), is("utf-8"));
    }
    {
        HttpRequestMethod httpRequestMethod = HttpRequestMethod.GET;
        String url = "http://example.com";
        HttpParameter[] parameters = new HttpParameter[]{new HttpParameter("key", "value")};
        HttpRequest httpRequest = new HttpRequest(httpRequestMethod, url, parameters);
        assertThat(httpRequest.getEncoding(), is("utf-8"));
    }
}