modify the autocomplete link structure of the index resources

This commit is contained in:
Mohamed Karray
2018-10-15 13:57:55 +02:00
parent 27ca8860d3
commit e891ce9850
3 changed files with 15 additions and 9 deletions

View File

@@ -99,8 +99,9 @@ public class IndexResourceTest {
public void shouldRenderAutoCompleteLinks() {
IndexDto index = indexResource.getIndex();
Assertions.assertThat(index.getLinks().getLinkBy("autocompleteUsers")).matches(Optional::isPresent);
Assertions.assertThat(index.getLinks().getLinkBy("autocompleteGroups")).matches(Optional::isPresent);
Assertions.assertThat(index.getLinks().getLinksBy("autocomplete"))
.extracting("name")
.containsExactlyInAnyOrder("users", "groups");
}
@Test
@@ -108,8 +109,9 @@ public class IndexResourceTest {
public void userWithoutAutocompletePermissionShouldNotSeeAutoCompleteLinks() {
IndexDto index = indexResource.getIndex();
Assertions.assertThat(index.getLinks().getLinkBy("autocompleteUsers")).matches(o -> !o.isPresent());
Assertions.assertThat(index.getLinks().getLinkBy("autocompleteGroups")).matches(o -> !o.isPresent());
Assertions.assertThat(index.getLinks().getLinksBy("autocomplete"))
.extracting("name")
.doesNotContainSequence("users", "groups");
}
@Test