DATAREST-1341 - Upgrade to Spring HATEOAS 1.0.
This commit is contained in:
committed by
Oliver Drotbohm
parent
a05d6a2a90
commit
af6f55a92c
@@ -83,7 +83,7 @@ public class ResourceTester {
|
||||
|
||||
private final Link assertHasLinkMatching(String rel, Matcher<String> hrefMatcher) {
|
||||
|
||||
Link link = resource.getLink(rel);
|
||||
Link link = resource.getRequiredLink(rel);
|
||||
assertThat("Expected link with rel '" + rel + "' but didn't find it in " + resource.getLinks(), link,
|
||||
is(notNullValue()));
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
|
||||
|
||||
assertThat(links.hasLink("firstname")).isTrue();
|
||||
|
||||
Link firstnameLink = links.getLink("firstname");
|
||||
Link firstnameLink = links.getLink("firstname").orElse(null);
|
||||
assertThat(firstnameLink.isTemplated()).isTrue();
|
||||
assertThat(firstnameLink.getVariableNames()).contains("page", "size");
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class PersistentEntityResourceAssemblerIntegrationTests extends AbstractC
|
||||
Links links = new Links(resource.getLinks());
|
||||
|
||||
assertThat(links).hasSize(2);
|
||||
assertThat(links.getLink("self").getVariables()).isEmpty();
|
||||
assertThat(links.getLink("user").getVariableNames()).contains("projection");
|
||||
assertThat(links.getLink("self").orElseThrow(() -> new RuntimeException("Unable to find 'self' link")).getVariables()).isEmpty();
|
||||
assertThat(links.getLink("user").orElseThrow(() -> new RuntimeException("Unable to find 'user' link")).getVariableNames()).contains("projection");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user