Code example for HttpEntityEnclosingRequest

Methods: getEntity

0
        verify(consumer, times(1)).buildResult(context);
    } 
 
    @Test 
    public void testResponseProcessingWithException() throws Exception { 
        when(request.getEntity()).thenReturn(new StringEntity("stuff"));
        final RuntimeException ooopsie = new RuntimeException();
        when(consumer.buildResult(context)).thenThrow(ooopsie);
 
        consumer.requestReceived(request);
        consumer.consumeContent(decoder, ioctrl);
        consumer.requestCompleted(context);
 
        verify(consumer).releaseResources();
        Assert.assertTrue(consumer.isDone());
        Assert.assertSame(ooopsie, consumer.getException());
    } 
 
    @Test 
    public void testClose() throws Exception { 
        consumer.close();