@Test
public void testExecute() throws JspException, IOException {
JspFragment jspBody = createMock(JspFragment.class);
PageContext pageContext = createMock(PageContext.class);
JspTag parent = createMock(JspTag.class);
ApplicationContext applicationContext = createMock(ApplicationContext.class);
HttpServletRequest httpServletRequest = createMock(HttpServletRequest.class);
HttpServletResponse httpServletResponse = createMock(HttpServletResponse.class);
@SuppressWarnings("unchecked")
Map<String, Object> applicationScope = createMock(Map.class);
TilesContainer container = createMock(TilesContainer.class);
AttributeContext attributeContext = createMock(AttributeContext.class);
Attribute attribute = createMock(Attribute.class);
expect(pageContext.getAttribute(
ApplicationAccess.APPLICATION_CONTEXT_ATTRIBUTE,
PageContext.APPLICATION_SCOPE)).andReturn(applicationContext);
expect(applicationContext.getApplicationScope()).andReturn(applicationScope).anyTimes();
expect(pageContext.getRequest()).andReturn(httpServletRequest);
expect(pageContext.getResponse()).andReturn(httpServletResponse);
expect(pageContext.getAttribute(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME, PageContext.REQUEST_SCOPE)).andReturn(container);
expect(container.getAttributeContext(isA(JspRequest.class))).andReturn(attributeContext);
expect(attributeContext.getAttribute("name")).andReturn(attribute);