BaseCommand { public String createShowFileUrl() { assertNameSet(); return "/repos/" + repositoryName.toString() + "/show" + getPathStripTrailingSlash(); } BaseCommand(); String getPath(); String getEncodedPath(); void setPath(final String path); Revision getRevision(); void setRevision(final Revision revision); void setPegRevision(final Revision pegRevision); Revision getPegRevision(); boolean hasPegRevision(); long getRevisionNumber(); String getTarget(); String getEncodedTarget(); String getParentPath(); String getPathPart(); DirEntryComparator.SortType getSortType(); void setSortType(final DirEntryComparator.SortType sortType); DirEntrySorter.SortMode getSortMode(); void setSortMode(final DirEntrySorter.SortMode sortMode); void setName(final RepositoryName name); RepositoryName getName(); @Override boolean equals(final Object obj); @Override int hashCode(); String createListUrl(); String createShowFileUrl(); String getPathWithTrailingSlash(); @Override String toString();  }
@Test public void testCreateShowFileUrl() { final BaseCommand cmd = new BaseCommand(); cmd.setName(new RepositoryName("test")); cmd.setPath("/test/file"); assertEquals("/repos/test/show/test/file", cmd.createShowFileUrl()); cmd.setPath("/test/file/"); assertEquals("/repos/test/show/test/file", cmd.createShowFileUrl()); }