Skip to content

Commit 0e62f5d

Browse files
committed
Adapt to changes in Spring Data Commons' SortHandlerMethodArgumentResolver.
Fixes GH-2339. Related ticket: spring-projects/spring-data-commons#2531.
1 parent 19c3179 commit 0e62f5d

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/RepositorySearchControllerIntegrationTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ void rendersCorrectSearchLinksForPersons() throws Exception {
9090
tester.assertNumberOfLinks(7); // Self link included
9191
tester.assertHasLinkEndingWith("findFirstPersonByFirstName",
9292
"findFirstPersonByFirstName{?firstname,projection}");
93-
tester.assertHasLinkEndingWith("firstname", "firstname{?firstname,page,size,sort,projection}");
94-
tester.assertHasLinkEndingWith("lastname", "lastname{?lastname,sort,projection}");
93+
tester.assertHasLinkEndingWith("firstname", "firstname{?firstname,page,size,sort*,projection}");
94+
tester.assertHasLinkEndingWith("lastname", "lastname{?lastname,sort*,projection}");
9595
tester.assertHasLinkEndingWith("findByCreatedUsingISO8601Date",
96-
"findByCreatedUsingISO8601Date{?date,page,size,sort,projection}");
96+
"findByCreatedUsingISO8601Date{?date,page,size,sort*,projection}");
9797
tester.assertHasLinkEndingWith("findByCreatedGreaterThan",
98-
"findByCreatedGreaterThan{?date,page,size,sort,projection}");
98+
"findByCreatedGreaterThan{?date,page,size,sort*,projection}");
9999
tester.assertHasLinkEndingWith("findCreatedDateByLastName", "findCreatedDateByLastName{?lastname}");
100100
}
101101

spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/jpa/JpaWebTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,12 @@ void exectuesSearchThatTakesASort() throws Exception {
554554
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
555555

556556
// Assert results returned as specified
557-
client.follow(findBySortedLink.expand(Arrays.asList("title", "desc"))).//
557+
client.follow(findBySortedLink.expand("title,desc")).//
558558
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
559559
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
560560
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
561561

562-
client.follow(findBySortedLink.expand(Arrays.asList("title", "asc"))).//
562+
client.follow(findBySortedLink.expand("title,asc")).//
563563
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data")).//
564564
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data (Second Edition)")).//
565565
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
@@ -649,12 +649,12 @@ void exectuesSearchThatTakesAMappedSortProperty() throws Exception {
649649
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
650650

651651
// Assert results returned as specified
652-
client.follow(findBySortedLink.expand(Arrays.asList("sales", "desc"))).//
652+
client.follow(findBySortedLink.expand("sales,desc")).//
653653
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
654654
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
655655
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
656656

657-
client.follow(findBySortedLink.expand(Arrays.asList("sales", "asc"))).//
657+
client.follow(findBySortedLink.expand("sales,asc")).//
658658
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data")).//
659659
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data (Second Edition)")).//
660660
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
@@ -669,12 +669,12 @@ void exectuesCustomQuerySearchThatTakesAMappedSortProperty() throws Exception {
669669
assertThat(findByLink.isTemplated()).isTrue();
670670

671671
// Assert results returned as specified
672-
client.follow(findByLink.expand("0", "10", Arrays.asList("sales", "desc"))).//
672+
client.follow(findByLink.expand("0", "10", "sales,desc")).//
673673
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
674674
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
675675
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
676676

677-
client.follow(findByLink.expand("0", "10", Arrays.asList("unknown", "asc", "sales", "asc"))).//
677+
client.follow(findByLink.expand("0", "10", Arrays.asList("unknown,asc", "sales,asc"))).//
678678
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data")).//
679679
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data (Second Edition)")).//
680680
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));
@@ -706,7 +706,7 @@ void appliesSortByEmbeddedAssociation() throws Exception {
706706
assertThat(findBySortedLink.getVariableNames()).contains("sort", "projection");
707707

708708
// Assert results returned as specified
709-
client.follow(findBySortedLink.expand(Arrays.asList("offer.price", "desc"))).//
709+
client.follow(findBySortedLink.expand("offer.price,desc")).//
710710
andExpect(jsonPath("$._embedded.books[0].title").value("Spring Data (Second Edition)")).//
711711
andExpect(jsonPath("$._embedded.books[1].title").value("Spring Data")).//
712712
andExpect(client.hasLinkWithRel(IanaLinkRelations.SELF));

0 commit comments

Comments
 (0)