Adapt to changes in Spring Data Commons' SortHandlerMethodArgumentResolver.

Fixes GH-2339.
Related ticket: spring-projects/spring-data-commons#2531.
This commit is contained in:
Oliver Drotbohm
2023-12-07 13:49:30 +01:00
parent 19c3179b31
commit 0e62f5ddff
2 changed files with 11 additions and 11 deletions

View File

@@ -90,12 +90,12 @@ class RepositorySearchControllerIntegrationTests extends AbstractControllerInteg
tester.assertNumberOfLinks(7); // Self link included
tester.assertHasLinkEndingWith("findFirstPersonByFirstName",
"findFirstPersonByFirstName{?firstname,projection}");
tester.assertHasLinkEndingWith("firstname", "firstname{?firstname,page,size,sort,projection}");
tester.assertHasLinkEndingWith("lastname", "lastname{?lastname,sort,projection}");
tester.assertHasLinkEndingWith("firstname", "firstname{?firstname,page,size,sort*,projection}");
tester.assertHasLinkEndingWith("lastname", "lastname{?lastname,sort*,projection}");
tester.assertHasLinkEndingWith("findByCreatedUsingISO8601Date",
"findByCreatedUsingISO8601Date{?date,page,size,sort,projection}");
"findByCreatedUsingISO8601Date{?date,page,size,sort*,projection}");
tester.assertHasLinkEndingWith("findByCreatedGreaterThan",
"findByCreatedGreaterThan{?date,page,size,sort,projection}");
"findByCreatedGreaterThan{?date,page,size,sort*,projection}");
tester.assertHasLinkEndingWith("findCreatedDateByLastName", "findCreatedDateByLastName{?lastname}");
}

View File

@@ -554,12 +554,12 @@ public class JpaWebTests extends CommonWebTests {
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
// 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[1].title").value("Spring Data")).//
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[1].title").value("Spring Data (Second Edition)")).//
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
@@ -649,12 +649,12 @@ public class JpaWebTests extends CommonWebTests {
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
// 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[1].title").value("Spring Data")).//
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[1].title").value("Spring Data (Second Edition)")).//
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
@@ -669,12 +669,12 @@ public class JpaWebTests extends CommonWebTests {
assertThat(findByLink.isTemplated()).isTrue();
// 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[1].title").value("Spring Data")).//
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[1].title").value("Spring Data (Second Edition)")).//
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
@@ -706,7 +706,7 @@ public class JpaWebTests extends CommonWebTests {
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
// 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[1].title").value("Spring Data")).//
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));