public void testCreateViewWithInvalidViewId() throws Exception
{
ViewHandlerSupport viewHandlerSupport = _mocksControl.createMock(ViewHandlerSupport.class);
_testimpl.setViewHandlerSupport(viewHandlerSupport);
expect(viewHandlerSupport.calculateViewId(same(_facesContext), eq("viewidxxx"))).andThrow(
new InvalidViewIdException("xxx"));
expect(_facesContext.getExternalContext()).andReturn(_externalContext);
HttpServletResponse httpServletResponse = _mocksControl.createMock(HttpServletResponse.class);
expect(_externalContext.getResponse()).andReturn(httpServletResponse);
httpServletResponse.sendError(eq(HttpServletResponse.SC_NOT_FOUND), (String) anyObject());