DATAREST-668 - Added test case to verify search links are created correctly.

Added a test case that explictly verifies the projection template variable being added to search links for domain types with projections registered.

Related tickets: DATAREST-467, DATAREST-519.
This commit is contained in:
Oliver Gierke
2015-09-03 17:56:14 +02:00
parent b4bbc1d79c
commit 7daca726c0

View File

@@ -174,4 +174,17 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
UriComponents components = UriComponentsBuilder.fromUriString(link.getHref()).build();
assertThat(components.getQueryParams(), hasKey("sort"));
}
/**
* @see DATAREST-668
* @see DATAREST-519
* @see DATAREST-467
*/
@Test
public void addsProjectVariableToSearchResourceIfAvailable() {
for (Link link : entityLinks.linksToSearchResources(Book.class)) {
assertThat(link.getVariableNames(), hasItem("projection"));
}
}
}