    @Test
    public void test_extractUrlEncodedFormPayload() {

        HttpServletRequest request = mock(HttpServletRequest.class);
        String encoding = "ASCII";
        when(request.getCharacterEncoding()).thenReturn(encoding);
        when(request.getQueryString()).thenReturn("y=y1");
        when(request.getParameterNames()).thenReturn(Collections.enumeration(Arrays.asList("x", "y")));
        when(request.getParameterValues("x")).thenReturn(new String[] {"x1", "x2"});
        when(request.getParameterValues("y")).thenReturn(new String[] {"y2"});
        HttpRequestPayload payload = urlEncodedFormHelper.extractUrlEncodedFormPayload(request, null);
        assertThat(payload.getMissingByteCount(), is(0));
        assertThat(new String(payload.getBytes(), Charset.forName(encoding)), is(equalTo("x=x1&x=x2&y=y2")));
    }