    @Test
    public void doBeforeRender_FoundBean() throws Exception {

        HippoBean detailBean = new MockHippoBean();

        ServletContext servletContext = createMock(ServletContext.class);
        ComponentConfiguration componentConfiguration = new MockComponentConfiguration();
        ObjectConverter objectConverter = createMock(ObjectConverter.class);

        HstRequest request = new MockHstRequest();
        Session session = createMock(Session.class);
        HstResponse response = createMock(HstResponse.class);

        HstRequestContext requestContext = new MockHstRequestContext();
        ((MockHstRequestContext) requestContext).setSession(session);
        ResolvedMount resolvedMount = createMock(ResolvedMount.class);
        Mount mount = createMock(Mount.class);
        ((MockHstRequestContext) requestContext).setResolvedMount(resolvedMount);

        ResolvedSiteMapItem resolvedSiteMapItem = new MockResolvedSiteMapItem();
        ((MockResolvedSiteMapItem) resolvedSiteMapItem).setRelativeContentPath("common/detail");
        ((MockHstRequestContext) requestContext).setResolvedSiteMapItem(resolvedSiteMapItem);
        ((MockHstRequest) request).setRequestContext(requestContext);

        expect(resolvedMount.getMount()).andReturn(mount);
        expect(mount.getContentPath()).andReturn("/hst:hst/hst:sites/mysite-live/hst:content");
        expect(servletContext.getAttribute("org.hippoecm.hst.component.support.bean.BaseHstComponent.objectConverter")).andReturn(objectConverter).anyTimes();

        expect(objectConverter.getObject(session, "/hst:hst/hst:sites/mysite-live/hst:content/common/detail")).andReturn(detailBean);

        replay(servletContext, objectConverter, resolvedMount, mount, response, session);

        Detail detail = new Detail();
        detail.init(servletContext, componentConfiguration);
        detail.doBeforeRender(request, response);
        verify(servletContext, objectConverter, resolvedMount, mount, response, session);

        assertEquals(detailBean, request.getAttribute("document"));
    }