complexDispatcherPortlet.setContextClass(ComplexPortletApplicationContext.class);
complexDispatcherPortlet.setNamespace("test");
complexDispatcherPortlet.setDetectAllHandlerMappings(false);
complexDispatcherPortlet.init(new MockPortletConfig(getPortletContext(), "complex"));
MockRenderRequest request = new MockRenderRequest();
MockRenderResponse response = new MockRenderResponse();
request.setParameter("myParam", "test1");
complexDispatcherPortlet.doDispatch(request, response);
Map model = (Map) request.getAttribute(ViewRendererServlet.MODEL_ATTRIBUTE);
Exception exception = (Exception) model.get("exception");
assertTrue(exception.getClass().equals(UnavailableException.class));