TilesApplicationContext applicationContext = createMock(TilesApplicationContext.class);
TilesContainer container = createMock(TilesContainer.class);
TilesRequestContextFactory requestContextFactory = createMock(TilesRequestContextFactory.class);
AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);
AttributeRenderer stringRenderer = createMock(TypeDetectingAttributeRenderer.class);
AttributeRenderer templateRenderer = createMock(TypeDetectingAttributeRenderer.class);
AttributeRenderer definitionRenderer = createMock(TypeDetectingAttributeRenderer.class);
AttributeRenderer velocityRenderer = createMock(TypeDetectingAttributeRenderer.class);
AttributeRenderer freemarkerRenderer = createMock(TypeDetectingAttributeRenderer.class);
expect(rendererFactory.getRenderer("string")).andReturn(stringRenderer);
expect(rendererFactory.getRenderer("template")).andReturn(templateRenderer);
expect(rendererFactory.getRenderer("definition")).andReturn(definitionRenderer);
expect(rendererFactory.getRenderer("velocity")).andReturn(velocityRenderer);
expect(rendererFactory.getRenderer("freemarker")).andReturn(freemarkerRenderer);
replay(container, requestContextFactory, attributeEvaluatorFactory,
rendererFactory, applicationContext);
AttributeRenderer renderer = factory.createDefaultAttributeRenderer(
rendererFactory, applicationContext, requestContextFactory,
container, attributeEvaluatorFactory);
assertTrue("The default renderer class is not correct",
renderer instanceof ChainedDelegateAttributeRenderer);
verify(container, requestContextFactory, attributeEvaluatorFactory,