@Test
public void getParameters() throws Exception {

    {
        HttpRequestMethod httpRequestMethod = HttpRequestMethod.POST;
        String url = "http://example.com";
        String encoding = "utf-8";
        HttpParameter[] parameters = new HttpParameter[0];
        HttpRequest httpRequest = new HttpRequest(httpRequestMethod, url, encoding, parameters);
        assertThat(httpRequest.getParameters(), is(not(nullValue())));
        assertThat(httpRequest.getParameters().length, is(0));
    }
    {
        HttpRequestMethod httpRequestMethod = HttpRequestMethod.POST;
        String url = "http://example.com";
        String encoding = "utf-8";
        HttpRequest httpRequest = new HttpRequest(httpRequestMethod, url, encoding);
        assertThat(httpRequest.getParameters(), is(not(nullValue())));
        assertThat(httpRequest.getParameters().length, is(0));
    }
    {
        HttpRequestMethod httpRequestMethod = HttpRequestMethod.POST;
        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.getParameters(), is(not(nullValue())));
        assertThat(httpRequest.getParameters().length, is(1));
        assertThat(httpRequest.getParameters()[0].getKey(), is("key"));
        assertThat(httpRequest.getParameters()[0].getValue(), is("value"));
    }
    {
        HttpRequestMethod httpRequestMethod = HttpRequestMethod.POST;
        String url = "http://example.com";
        String encoding = "utf-8";
        HttpParameter[] parameters = new HttpParameter[]{
                new HttpParameter("key", "value"),
                new HttpParameter("key2", "value2"),
        };
        HttpRequest httpRequest = new HttpRequest(httpRequestMethod, url, encoding, parameters);
        assertThat(httpRequest.getParameters(), is(not(nullValue())));
        assertThat(httpRequest.getParameters().length, is(2));
        assertThat(httpRequest.getParameters()[0].getKey(), is("key"));
        assertThat(httpRequest.getParameters()[0].getValue(), is("value"));
        assertThat(httpRequest.getParameters()[1].getKey(), is("key2"));
        assertThat(httpRequest.getParameters()[1].getValue(), is("value2"));
    }
}