Map<String, Object> requestScope = createMock(Map.class);
Deque<AttributeContext> deque = createMock(Deque.class);
AttributeContext attributeContext = createMock(AttributeContext.class);
Attribute templateAttribute = createMock(Attribute.class);
Renderer renderer = createMock(Renderer.class);
AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
expect(attributeContext.getPreparer()).andReturn("preparer").times(2);
expect(preparerFactory.getPreparer("preparer", request)).andReturn(null);
expect(attributeContext.getTemplateAttribute()).andReturn(templateAttribute);
expect(templateAttribute.getRenderer()).andReturn("renderer");
expect(rendererFactory.getRenderer("renderer")).andReturn(renderer);
expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
expect(evaluator.evaluate(templateAttribute, request)).andReturn("/mytemplate.jsp");
expect(templateAttribute.isPermitted(request)).andReturn(true);
renderer.render("/mytemplate.jsp", request);
expectLastCall().andThrow(new IOException());
replay(applicationContext, attributeEvaluatorFactory, evaluator,