public void testPrepare() {
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);
expect(preparerFactory.getPreparer("preparer", request)).andReturn(preparer);
expect(request.getContext("request")).andReturn(requestScope);
expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
expect(deque.isEmpty()).andReturn(false);
expect(deque.peek()).andReturn(attributeContext);
preparer.execute(request, attributeContext);
replay(applicationContext, attributeEvaluatorFactory,
definitionsFactory, preparerFactory, rendererFactory, request,
requestScope, deque, attributeContext, preparer);
container.prepare("preparer", request);