### Question:
TeamSystemWebAccessBrowser extends TeamFoundationServerRepositoryBrowser { @Override public URL getChangeSetLink(final ChangeSet changeSet) throws IOException { final String baseUrlString = getBaseUrlString(changeSet); final URL baseUrl = new URL(baseUrlString); return new URL(baseUrl, "_versionControl/changeset/" + changeSet.getVersion()); } @DataBoundConstructor  TeamSystemWebAccessBrowser(final String urlExample); String getUrl(); @Override URL getChangeSetLink(final ChangeSet changeSet); URL getFileLink(final ChangeSet.Item item); URL getDiffLink(final ChangeSet.Item item);  }### Answer:
@Test public void assertChangeSetLinkWithServerUrlWithPort() throws Exception { TeamSystemWebAccessBrowser browser = new TeamSystemWebAccessBrowser("http: ChangeSet changeSet = new ChangeSet("99", null, "user", "comment"); URL actual = browser.getChangeSetLink(changeSet); assertEquals("The change set link was incorrect", "http: }
@Test public void assertChangeSetLinkWithRealisticServerUrlWithPort() throws Exception { TeamSystemWebAccessBrowser browser = new TeamSystemWebAccessBrowser("http: ChangeSet changeSet = new ChangeSet("99", null, "user", "comment"); URL actual = browser.getChangeSetLink(changeSet); assertEquals("The change set link was incorrect", "http: }
@Test public void assertChangeSetLinkWithRealisticServerUrl() throws Exception { TeamSystemWebAccessBrowser browser = new TeamSystemWebAccessBrowser("http: ChangeSet changeSet = new ChangeSet("99", null, "user", "comment"); URL actual = browser.getChangeSetLink(changeSet); assertEquals("The change set link was incorrect", "http: }
@Bug(7394) @Test public void assertChangeSetLinkWithOnlyServerUrl() throws Exception { TeamSystemWebAccessBrowser browser = new TeamSystemWebAccessBrowser("http: ChangeSet changeSet = new ChangeSet("99", null, "user", "comment"); URL actual = browser.getChangeSetLink(changeSet); assertEquals("The change set link was incorrect", "http: }
@Bug(7394) @Test public void assertChangeSetLinkWithOnlyServerUrlWithTrailingSlash() throws Exception { TeamSystemWebAccessBrowser browser = new TeamSystemWebAccessBrowser("http: ChangeSet changeSet = new ChangeSet("99", null, "user", "comment"); URL actual = browser.getChangeSetLink(changeSet); assertEquals("The change set link was incorrect","http: }
@Test public void assertChangeSetLinkUsesScmConfiguration() throws Exception { AbstractBuild build = mock(AbstractBuild.class); AbstractProject<?,?> project = mock(AbstractProject.class); when(build.getProject()).thenReturn(project); final TeamFoundationServerScm testScm = createTestScm(null); when(project.getScm()).thenReturn(testScm); ChangeSet changeset = new ChangeSet("62643", null, "user", "comment"); new ChangeLogSet(build, new ChangeSet[]{ changeset}); TeamSystemWebAccessBrowser browser = new TeamSystemWebAccessBrowser(""); URL actual = browser.getChangeSetLink(changeset); assertEquals("The change set link was incorrect", "http: }
@Test public void assertChangeSetLinkUsesScmConfigurationNoSlash() throws Exception { AbstractBuild build = mock(AbstractBuild.class); AbstractProject<?,?> project = mock(AbstractProject.class); when(build.getProject()).thenReturn(project); final TeamFoundationServerScm testScm = createTestScm("http: when(project.getScm()).thenReturn(testScm); ChangeSet changeset = new ChangeSet("62643", null, "user", "comment"); new ChangeLogSet(build, new ChangeSet[]{ changeset}); TeamSystemWebAccessBrowser browser = new TeamSystemWebAccessBrowser(""); URL actual = browser.getChangeSetLink(changeset); assertEquals("The change set link was incorrect", "http: }