@Test
public void testRenderStringRequest() throws IOException {
Request request = createMock(Request.class);
Map<String, Object> requestScope = createMock(Map.class);
Deque<AttributeContext> deque = createMock(Deque.class);
AttributeContext attributeContext = createMock(AttributeContext.class);
ViewPreparer preparer = createMock(ViewPreparer.class);
Renderer renderer = createMock(Renderer.class);
Definition definition = createMock(Definition.class);
AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
Attribute templateAttribute = Attribute.createTemplateAttribute("/my/template.jsp");
expect(definitionsFactory.getDefinition("definition", request)).andReturn(definition);
expect(request.getContext("request")).andReturn(requestScope).times(3);
expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque).times(3);
expect(deque.isEmpty()).andReturn(false);
expect(deque.peek()).andReturn(attributeContext);
expect(attributeContext.getPreparer()).andReturn(null);
expect(attributeContext.getTemplateAttribute()).andReturn(templateAttribute);
expect(attributeContext.getLocalAttributeNames()).andReturn(null);
expect(attributeContext.getCascadedAttributeNames()).andReturn(null);
expect(definition.getTemplateAttribute()).andReturn(templateAttribute);
expect(rendererFactory.getRenderer("template")).andReturn(renderer);
deque.push(isA(BasicAttributeContext.class));
expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
expect(evaluator.evaluate(templateAttribute, request)).andReturn("/my/template.jsp");