return assertHasLinkMatching(rel, hrefEnd == null ? null : endsWith(hrefEnd));
}
private final Link assertHasLinkMatching(String rel, Matcher<String> hrefMatcher) {
Link link = resource.getLink(rel);
assertThat("Expected link with rel '" + rel + "' but didn't find it in " + resource.getLinks(), link,
is(notNullValue()));
if (hrefMatcher != null) {
assertThat(link.getHref(), is(hrefMatcher));
}
return link;
}