DLEditFileShortcutDisplayContext { public String getTitle() { FileShortcut fileShortcut = _getFileShortcut(); if (fileShortcut != null) { return _language.get( _liferayPortletRequest.getHttpServletRequest(), "shortcut-to-x", fileShortcut.getToTitle()); } return _language.get( _liferayPortletRequest.getHttpServletRequest(), "new-file-shortcut"); } DLEditFileShortcutDisplayContext(
		DLAppService dlAppService, ItemSelector itemSelector, Language language,
		LiferayPortletRequest liferayPortletRequest,
		LiferayPortletResponse liferayPortletResponse); String getEditFileShortcutURL(); long getFileShortcutId(); long getFolderId(); String getItemSelectorURL(); long getRepositoryId(); String getTitle(); long getToFileEntryId(); String getToFileEntryTitle(); boolean isPermissionConfigurable();  }
@Test public void testGetTitleWithAttribute() { FileShortcut fileShortcut = _addRandomFileShortcut(); DLEditFileShortcutDisplayContext dlEditFileShortcutDisplayContext = _getDLEditFileShortcutDisplayContext( new MockHttpServletRequestBuilder().withAttribute( WebKeys.DOCUMENT_LIBRARY_FILE_SHORTCUT, fileShortcut ).build()); Mockito.when( _language.get( Mockito.any(HttpServletRequest.class), Mockito.eq("shortcut-to-x"), Mockito.anyString()) ).thenReturn( "Short Cut To X" ); Assert.assertEquals( "Short Cut To X", dlEditFileShortcutDisplayContext.getTitle()); }
@Test public void testGetTitleWithoutAttribute() { DLEditFileShortcutDisplayContext dlEditFileShortcutDisplayContext = _getDLEditFileShortcutDisplayContext(new MockHttpServletRequest()); Mockito.when( _language.get( Mockito.any(HttpServletRequest.class), Mockito.eq("new-file-shortcut")) ).thenReturn( "New" ); Assert.assertEquals("New", dlEditFileShortcutDisplayContext.getTitle()); }