mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 02:31:14 +01:00
Fixes self-links in sources
This commit is contained in:
@@ -71,7 +71,7 @@ public class BrowserResultToBrowserResultDtoMapperTest {
|
||||
public void shouldMapAttributesCorrectly() {
|
||||
BrowserResult browserResult = createBrowserResult();
|
||||
|
||||
BrowserResultDto dto = mapper.map(browserResult, new NamespaceAndName("foo", "bar"));
|
||||
BrowserResultDto dto = mapper.map(browserResult, new NamespaceAndName("foo", "bar"), "path");
|
||||
|
||||
assertEqualAttributes(browserResult, dto);
|
||||
}
|
||||
@@ -81,12 +81,22 @@ public class BrowserResultToBrowserResultDtoMapperTest {
|
||||
BrowserResult browserResult = createBrowserResult();
|
||||
NamespaceAndName namespaceAndName = new NamespaceAndName("foo", "bar");
|
||||
|
||||
BrowserResultDto dto = mapper.map(browserResult, namespaceAndName);
|
||||
BrowserResultDto dto = mapper.map(browserResult, namespaceAndName, "path");
|
||||
|
||||
verify(fileObjectToFileObjectDtoMapper).map(fileObject1, namespaceAndName, "Revision");
|
||||
verify(fileObjectToFileObjectDtoMapper).map(fileObject2, namespaceAndName, "Revision");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldSetLinksCorrectly() {
|
||||
BrowserResult browserResult = createBrowserResult();
|
||||
NamespaceAndName namespaceAndName = new NamespaceAndName("foo", "bar");
|
||||
|
||||
BrowserResultDto dto = mapper.map(browserResult, namespaceAndName, "path");
|
||||
|
||||
assertThat(dto.getLinks().getLinkBy("self").get().getHref()).contains("path");
|
||||
}
|
||||
|
||||
private BrowserResult createBrowserResult() {
|
||||
BrowserResult browserResult = new BrowserResult();
|
||||
browserResult.setTag("Tag");
|
||||
|
||||
Reference in New Issue
Block a user