Adapt to changes in Spring Data Commons' SortHandlerMethodArgumentResolver.
Fixes GH-2339. Related ticket: spring-projects/spring-data-commons#2531.
This commit is contained in:
@@ -90,12 +90,12 @@ class RepositorySearchControllerIntegrationTests extends AbstractControllerInteg
|
|||||||
tester.assertNumberOfLinks(7); // Self link included
|
tester.assertNumberOfLinks(7); // Self link included
|
||||||
tester.assertHasLinkEndingWith("findFirstPersonByFirstName",
|
tester.assertHasLinkEndingWith("findFirstPersonByFirstName",
|
||||||
"findFirstPersonByFirstName{?firstname,projection}");
|
"findFirstPersonByFirstName{?firstname,projection}");
|
||||||
tester.assertHasLinkEndingWith("firstname", "firstname{?firstname,page,size,sort,projection}");
|
tester.assertHasLinkEndingWith("firstname", "firstname{?firstname,page,size,sort*,projection}");
|
||||||
tester.assertHasLinkEndingWith("lastname", "lastname{?lastname,sort,projection}");
|
tester.assertHasLinkEndingWith("lastname", "lastname{?lastname,sort*,projection}");
|
||||||
tester.assertHasLinkEndingWith("findByCreatedUsingISO8601Date",
|
tester.assertHasLinkEndingWith("findByCreatedUsingISO8601Date",
|
||||||
"findByCreatedUsingISO8601Date{?date,page,size,sort,projection}");
|
"findByCreatedUsingISO8601Date{?date,page,size,sort*,projection}");
|
||||||
tester.assertHasLinkEndingWith("findByCreatedGreaterThan",
|
tester.assertHasLinkEndingWith("findByCreatedGreaterThan",
|
||||||
"findByCreatedGreaterThan{?date,page,size,sort,projection}");
|
"findByCreatedGreaterThan{?date,page,size,sort*,projection}");
|
||||||
tester.assertHasLinkEndingWith("findCreatedDateByLastName", "findCreatedDateByLastName{?lastname}");
|
tester.assertHasLinkEndingWith("findCreatedDateByLastName", "findCreatedDateByLastName{?lastname}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -554,12 +554,12 @@ public class JpaWebTests extends CommonWebTests {
|
|||||||
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
|
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
|
||||||
|
|
||||||
// Assert results returned as specified
|
// Assert results returned as specified
|
||||||
client.follow(findBySortedLink.expand(Arrays.asList("title", "desc"))).//
|
client.follow(findBySortedLink.expand("title,desc")).//
|
||||||
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
|
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
|
||||||
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
|
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
|
||||||
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
||||||
|
|
||||||
client.follow(findBySortedLink.expand(Arrays.asList("title", "asc"))).//
|
client.follow(findBySortedLink.expand("title,asc")).//
|
||||||
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data")).//
|
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data")).//
|
||||||
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data (Second Edition)")).//
|
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data (Second Edition)")).//
|
||||||
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
||||||
@@ -649,12 +649,12 @@ public class JpaWebTests extends CommonWebTests {
|
|||||||
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
|
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
|
||||||
|
|
||||||
// Assert results returned as specified
|
// Assert results returned as specified
|
||||||
client.follow(findBySortedLink.expand(Arrays.asList("sales", "desc"))).//
|
client.follow(findBySortedLink.expand("sales,desc")).//
|
||||||
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
|
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
|
||||||
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
|
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
|
||||||
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
||||||
|
|
||||||
client.follow(findBySortedLink.expand(Arrays.asList("sales", "asc"))).//
|
client.follow(findBySortedLink.expand("sales,asc")).//
|
||||||
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data")).//
|
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data")).//
|
||||||
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data (Second Edition)")).//
|
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data (Second Edition)")).//
|
||||||
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
||||||
@@ -669,12 +669,12 @@ public class JpaWebTests extends CommonWebTests {
|
|||||||
assertThat(findByLink.isTemplated()).isTrue();
|
assertThat(findByLink.isTemplated()).isTrue();
|
||||||
|
|
||||||
// Assert results returned as specified
|
// Assert results returned as specified
|
||||||
client.follow(findByLink.expand("0", "10", Arrays.asList("sales", "desc"))).//
|
client.follow(findByLink.expand("0", "10", "sales,desc")).//
|
||||||
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
|
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
|
||||||
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
|
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
|
||||||
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
||||||
|
|
||||||
client.follow(findByLink.expand("0", "10", Arrays.asList("unknown", "asc", "sales", "asc"))).//
|
client.follow(findByLink.expand("0", "10", Arrays.asList("unknown,asc", "sales,asc"))).//
|
||||||
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data")).//
|
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data")).//
|
||||||
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data (Second Edition)")).//
|
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data (Second Edition)")).//
|
||||||
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
||||||
@@ -706,7 +706,7 @@ public class JpaWebTests extends CommonWebTests {
|
|||||||
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
|
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
|
||||||
|
|
||||||
// Assert results returned as specified
|
// Assert results returned as specified
|
||||||
client.follow(findBySortedLink.expand(Arrays.asList("offer.price", "desc"))).//
|
client.follow(findBySortedLink.expand("offer.price,desc")).//
|
||||||
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
|
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
|
||||||
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
|
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
|
||||||
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
|
||||||
|
|||||||
Reference in New Issue
Block a user