use of org.apache.sling.engine.impl.helper.ExternalServletContextWrapper.RequestDispatcherWrapper in project sling by apache.
the class ExternalServletContextWrapperTest method testGetRequestDispatcher.
/**
* Tests that the RequestDispatcher is wrapped.
*/
@Test
public void testGetRequestDispatcher() {
final RequestDispatcher rd = context.mock(RequestDispatcher.class);
final ServletContext ctx = context.mock(ServletContext.class);
context.checking(new Expectations() {
{
oneOf(ctx).getRequestDispatcher("foo.jsp");
will(returnValue(rd));
}
});
ExternalServletContextWrapper wrapper = new ExternalServletContextWrapper(ctx);
RequestDispatcher dispatcher = wrapper.getRequestDispatcher("foo.jsp");
assertTrue(dispatcher instanceof RequestDispatcherWrapper);
assertEquals(rd, ((RequestDispatcherWrapper) dispatcher).getDelegate());
}
Aggregations