* Tests
* {@link ServletUtil#setCurrentContainer(ServletRequest, String)}.
*/
@Test
public void testSetCurrentContainer() {
Request request = createMock(Request.class);
ApplicationContext context = createMock(ApplicationContext.class);
TilesContainer container = createMock(TilesContainer.class);
Map<String, Object> attribs = new HashMap<String, Object>();
attribs.put("myKey", container);
Map<String, Object> requestScope = new HashMap<String, Object>();
expect(context.getApplicationScope()).andReturn(attribs).anyTimes();
expect(request.getContext("request")).andReturn(requestScope);
expect(request.getApplicationContext()).andReturn(context);
replay(request, context, container);
TilesAccess.setCurrentContainer(request, "myKey");
assertEquals(container, requestScope.get(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME));
verify(request, context, container);
}