TitleProvider { public String getTitle(HttpServletRequest httpServletRequest) throws PortalException { ThemeDisplay themeDisplay = (ThemeDisplay)httpServletRequest.getAttribute( WebKeys.THEME_DISPLAY); String portletId = (String)httpServletRequest.getAttribute( WebKeys.PORTLET_ID); ListMergeable<String> titleListMergeable = (ListMergeable<String>)httpServletRequest.getAttribute( WebKeys.PAGE_TITLE); ListMergeable<String> subtitleListMergeable = (ListMergeable<String>)httpServletRequest.getAttribute( WebKeys.PAGE_SUBTITLE); Company company = themeDisplay.getCompany(); return _layoutSEOLinkManager.getFullPageTitle( themeDisplay.getLayout(), portletId, themeDisplay.getTilesTitle(), titleListMergeable, subtitleListMergeable, company.getName(), themeDisplay.getLocale()); } TitleProvider(LayoutSEOLinkManager layoutSEOLinkManager); String getTitle(HttpServletRequest httpServletRequest);  }
@Test public void testGetTitle() throws PortalException { MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest(); ThemeDisplay themeDisplay = new ThemeDisplay(); themeDisplay.setCompany(Mockito.mock(Company.class)); mockHttpServletRequest.setAttribute( WebKeys.THEME_DISPLAY, themeDisplay); Assert.assertEquals( "htmlTitle", _titleProvider.getTitle(mockHttpServletRequest)); }