@SuppressWarnings("unchecked") @Test public void testRender() { Request request = createMock(Request.class); Map<String, Definition> definitions = createMock(Map.class); Map<String, Object> scope = createMock(Map.class); Definition definition = createMock(Definition.class); expect(request.getContext("request")).andReturn(scope); expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn( definitions); expect(definitions.get("definition")).andReturn(definition); container.render(definition, request); replay(wrapped, request, definitions, scope, definition); container.render("definition", request); verify(wrapped, request, definitions, scope, definition); }
@Override public void render(String definition, Request request) { Definition toRender = getDefinition(definition, request); if (toRender == null) { throw new NoSuchDefinitionException( "Cannot find definition named '" + definition + "'"); } super.render(toRender, request); }
CachingTilesContainer extends TilesContainerWrapper implements MutableTilesContainer { @Override public void render(String definition, Request request) { Definition toRender = getDefinition(definition, request); if (toRender == null) { throw new NoSuchDefinitionException( "Cannot find definition named '" + definition + "'"); } super.render(toRender, request); } }
CachingTilesContainer extends TilesContainerWrapper implements MutableTilesContainer { @Override public void render(String definition, Request request) { Definition toRender = getDefinition(definition, request); if (toRender == null) { throw new NoSuchDefinitionException( "Cannot find definition named '" + definition + "'"); } super.render(toRender, request); } CachingTilesContainer(TilesContainer originalContainer);  CachingTilesContainer(TilesContainer originalContainer, String definitionsAttributeName); }
CachingTilesContainer extends TilesContainerWrapper implements MutableTilesContainer { @Override public void render(String definition, Request request) { Definition toRender = getDefinition(definition, request); if (toRender == null) { throw new NoSuchDefinitionException( "Cannot find definition named '" + definition + "'"); } super.render(toRender, request); } CachingTilesContainer(TilesContainer originalContainer);  CachingTilesContainer(TilesContainer originalContainer, String definitionsAttributeName); Definition getDefinition(String definition,
            Request request); @Override boolean isValidDefinition(String definition, Request request); @Override void register(Definition definition, Request request); @Override void render(String definition, Request request); }
CachingTilesContainer extends TilesContainerWrapper implements MutableTilesContainer { @Override public void render(String definition, Request request) { Definition toRender = getDefinition(definition, request); if (toRender == null) { throw new NoSuchDefinitionException( "Cannot find definition named '" + definition + "'"); } super.render(toRender, request); } CachingTilesContainer(TilesContainer originalContainer);  CachingTilesContainer(TilesContainer originalContainer, String definitionsAttributeName); Definition getDefinition(String definition,
            Request request); @Override boolean isValidDefinition(String definition, Request request); @Override void register(Definition definition, Request request); @Override void render(String definition, Request request);  }