List of usage examples for org.springframework.hateoas Links hasLink
public boolean hasLink(LinkRelation relation)
From source file:org.springframework.data.rest.webmvc.jpa.JpaWebTests.java
/** * @see DATAREST-658/*from w w w . j a v a2 s .c o m*/ */ @Test public void returnsLinkHeadersForHeadRequestToItemResource() throws Exception { MockHttpServletResponse response = client.request(client.discoverUnique("people")); String personHref = JsonPath.read(response.getContentAsString(), "$._embedded.people[0]._links.self.href"); response = mvc.perform(head(personHref))// .andExpect(status().isNoContent())// .andReturn().getResponse(); Links links = Links.valueOf(response.getHeader("Link")); assertThat(links.hasLink("self"), is(true)); assertThat(links.hasLink("person"), is(true)); }