only map additional information for branches on branchesOverview to improve performance

This commit is contained in:
Eduard Heimbuch
2020-09-16 14:37:18 +02:00
parent 909f5ebec9
commit d6c129915b
10 changed files with 54 additions and 33 deletions

View File

@@ -79,8 +79,10 @@ class BranchToBranchDtoMapperTest {
Branch branch = Branch.normalBranch("master", "42");
BranchDto dto = mapper.map(branch, new NamespaceAndName("hitchhiker", "heart-of-gold"));
BranchDto dto = mapper.map(branch, new NamespaceAndName("hitchhiker", "heart-of-gold"), false);
assertThat(dto.getLinks().getLinkBy("ka").get().getHref()).isEqualTo("http://hitchhiker/heart-of-gold/master");
assertThat(dto.getLastModified()).isNull();
assertThat(dto.getLastModifier()).isNull();
}
@Test
@@ -94,7 +96,7 @@ class BranchToBranchDtoMapperTest {
when(logCommandBuilder.getChangesets()).thenReturn(new ChangesetPagingResult(1, ImmutableList.of(changeset)));
Branch branch = Branch.normalBranch("master", "42");
BranchDto dto = mapper.map(branch, new NamespaceAndName("hitchhiker", "heart-of-gold"));
BranchDto dto = mapper.map(branch, new NamespaceAndName("hitchhiker", "heart-of-gold"), true);
assertThat(dto.getLastModified()).isEqualTo(Instant.ofEpochMilli(creationTime));
assertThat(dto.getLastModifier().getName()).isEqualTo(PersonTestData.ZAPHOD.getName());