    @Test
    public void testReadingForm() throws IOException {

        EasyMock.expect(context.getEntityStream()).andReturn(new ByteArrayInputStream("foo=bar".getBytes()));
        EasyMock.expect(context.getMediaType()).andReturn(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
        context.setEntityStream(EasyMock.anyObject(InputStream.class));

        EasyMock.replay(context);

        Form form = underTest.getForm(context);
        assertEquals("bar", form.asMap().getFirst("foo"));
    }