GenericServlet servlet = createMock(GenericServlet.class);
ServletContext servletContext = createMock(ServletContext.class);
TilesContainer container = createMock(TilesContainer.class);
expect(servlet.getServletContext()).andReturn(servletContext).times(2);
replay(servlet, objectWrapper);
ServletContextHashModel servletContextModel = new ServletContextHashModel(servlet, objectWrapper);
expect(model.get("Request")).andReturn(requestModel);
request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container);
expect(model.get("Application")).andReturn(servletContextModel);
expect(servletContext.getAttribute("myKey")).andReturn(container);