@Test
public void testResourcePortletRequest() throws NoSuchFieldException, IllegalAccessException {

    ApplicationContext applicationContext = createMock(ApplicationContext.class);
    PortletContext portletContext = createMock(PortletContext.class);
    ResourceRequest request = createMock(ResourceRequest.class);
    ResourceResponse response = createMock(ResourceResponse.class);
    replay(applicationContext, portletContext, request, response);
    ResourcePortletRequest req = new ResourcePortletRequest(applicationContext,
            portletContext, request, response);
    Class<? extends ResourcePortletRequest> clazz = req.getClass();
    Field field = clazz.getSuperclass().getDeclaredField("requestDelegate");
    assertTrue(field.get(req) instanceof PortletRequestDelegate);
    field = clazz.getSuperclass().getDeclaredField("responseDelegate");
    assertTrue(field.get(req) instanceof MimeResponseDelegate);
    verify(applicationContext, portletContext, request, response);
}