DLEditFileShortcutDisplayContext { public String getEditFileShortcutURL() { PortletURL portletURL = _liferayPortletResponse.createActionURL(); portletURL.setParameter( ActionRequest.ACTION_NAME, "/document_library/edit_file_shortcut"); if (_getFileShortcut() == null) { portletURL.setParameter(Constants.CMD, Constants.ADD); } else { portletURL.setParameter(Constants.CMD, Constants.UPDATE); } return portletURL.toString(); } 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 testGetEditFileShortcutURLWithAttribute() throws URISyntaxException { FileShortcut fileShortcut = _addRandomFileShortcut(); DLEditFileShortcutDisplayContext dlEditFileShortcutDisplayContext = _getDLEditFileShortcutDisplayContext( new MockHttpServletRequestBuilder().withAttribute( WebKeys.DOCUMENT_LIBRARY_FILE_SHORTCUT, fileShortcut ).build()); AbstractUriAssert<?> abstractUriAssert = Assertions.assertThat( new URI(dlEditFileShortcutDisplayContext.getEditFileShortcutURL())); abstractUriAssert.hasParameter(Constants.CMD, Constants.UPDATE); }
@Test public void testGetEditFileShortcutURLWithoutAttribute() throws URISyntaxException { DLEditFileShortcutDisplayContext dlEditFileShortcutDisplayContext = _getDLEditFileShortcutDisplayContext(new MockHttpServletRequest()); AbstractUriAssert<?> abstractUriAssert = Assertions.assertThat( new URI(dlEditFileShortcutDisplayContext.getEditFileShortcutURL())); abstractUriAssert.hasParameter(Constants.CMD, Constants.ADD); }