PutAttributeModel { public void execute(@Parameter(required = true) String name, Object value, String expression, String role, String type, boolean cascade, Request request, ModelBody modelBody) throws IOException { Deque<Object> composeStack = ComposeStackUtil.getComposeStack(request); Attribute attribute = new Attribute(); composeStack.push(attribute); String currentBody = modelBody.evaluateAsString(); TilesContainer container = TilesAccess.getCurrentContainer(request); attribute = (Attribute) composeStack.pop(); putAttributeInParent(attribute, container, composeStack, name, value, expression, currentBody, role, type, cascade, request); }  void execute(@Parameter(required = true) String name, Object value,
            String expression, String role, String type, boolean cascade,
            Request request, ModelBody modelBody);  }
@Test public void testExecuteListAttribute() throws IOException { TilesContainer container = createMock(TilesContainer.class); Request request = createMock(Request.class); ModelBody modelBody = createMock(ModelBody.class); AttributeContext attributeContext = createMock(AttributeContext.class); Deque<Object> composeStack = new ArrayDeque<Object>(); ListAttribute listAttribute = new ListAttribute(); composeStack.push(listAttribute); Map<String, Object> requestScope = new HashMap<String, Object>(); requestScope.put(ComposeStackUtil.COMPOSE_STACK_ATTRIBUTE_NAME, composeStack); requestScope.put(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); ApplicationContext applicationContext = createMock(ApplicationContext.class); expect(request.getApplicationContext()).andReturn(applicationContext); expect(request.getContext("request")).andReturn(requestScope).anyTimes(); expect(container.getAttributeContext(request)).andReturn(attributeContext); attributeContext.putAttribute(eq("myName"), (Attribute) notNull(), eq(false)); expect(modelBody.evaluateAsString()).andReturn(null); replay(container, attributeContext, request, applicationContext, modelBody); model.execute("myName", "myValue", "myExpression", "myRole", "myType", false, request, modelBody); verify(container, attributeContext, request, applicationContext, modelBody); }