@Test public void content_type_from_component() { RequestPageCache cache = mockRequestPageCache(); PageContentTypeAnalyzer analyzer = mockPageContentTypeAnalyzer(); Component component = mockComponent(); String pageName = "foo/bar"; Page page = mockPage(); ContentType contentType = new ContentType("zig/zag"); ComponentResources resources = mockComponentResources(); train_getComponentResources(component, resources); train_getPageName(resources, pageName); train_get(cache, pageName, page); train_findContentType(analyzer, page, contentType); replay(); ResponseRenderer renderer = new ResponseRendererImpl(cache, analyzer, null); assertSame(renderer.findContentType(component), contentType); verify(); }
public ContentType findContentType(Object component) { Component c = (Component) component; String pageName = c.getComponentResources().getPageName(); Page page = pageCache.get(pageName); return pageContentAnalyzer.findContentType(page); }
ResponseRendererImpl implements ResponseRenderer { public ContentType findContentType(Object component) { Component c = (Component) component; String pageName = c.getComponentResources().getPageName(); Page page = pageCache.get(pageName); return pageContentAnalyzer.findContentType(page); } }
ResponseRendererImpl implements ResponseRenderer { public ContentType findContentType(Object component) { Component c = (Component) component; String pageName = c.getComponentResources().getPageName(); Page page = pageCache.get(pageName); return pageContentAnalyzer.findContentType(page); } ResponseRendererImpl(RequestPageCache pageCache, PageContentTypeAnalyzer pageContentAnalyzer,
            PageResponseRenderer renderer); }
ResponseRendererImpl implements ResponseRenderer { public ContentType findContentType(Object component) { Component c = (Component) component; String pageName = c.getComponentResources().getPageName(); Page page = pageCache.get(pageName); return pageContentAnalyzer.findContentType(page); } ResponseRendererImpl(RequestPageCache pageCache, PageContentTypeAnalyzer pageContentAnalyzer,
            PageResponseRenderer renderer); ContentType findContentType(Object component); void renderPageMarkupResponse(String pageName); }
ResponseRendererImpl implements ResponseRenderer { public ContentType findContentType(Object component) { Component c = (Component) component; String pageName = c.getComponentResources().getPageName(); Page page = pageCache.get(pageName); return pageContentAnalyzer.findContentType(page); } ResponseRendererImpl(RequestPageCache pageCache, PageContentTypeAnalyzer pageContentAnalyzer,
            PageResponseRenderer renderer); ContentType findContentType(Object component); void renderPageMarkupResponse(String pageName);  }