@@ -196,7 +196,7 @@ void scrollByExampleWithNoOffset(@Autowired QueryDSLPersonRepository repository)
196
196
Predicate predicate = Expressions .predicate (Ops .EQ , firstNamePath , Expressions .asString ("Helge" ))
197
197
.or (Expressions .predicate (Ops .EQ , lastNamePath , Expressions .asString ("B." )));
198
198
199
- repository .findBy (predicate , q -> q .limit (1 ).scroll (ScrollPosition .offset (0 )))
199
+ repository .findBy (predicate , q -> q .limit (1 ).sortBy ( Sort . by ( "firstName" ). descending ()). scroll (ScrollPosition .offset (0 )))
200
200
.as (StepVerifier ::create )
201
201
.expectNextMatches (peopleWindow -> {
202
202
@@ -217,7 +217,7 @@ void scrollByExampleWithOffset(@Autowired QueryDSLPersonRepository repository) {
217
217
Predicate predicate = Expressions .predicate (Ops .EQ , firstNamePath , Expressions .asString ("Helge" ))
218
218
.or (Expressions .predicate (Ops .EQ , lastNamePath , Expressions .asString ("B." )));
219
219
220
- repository .findBy (predicate , q -> q .limit (1 ).scroll (ScrollPosition .offset (1 )))
220
+ repository .findBy (predicate , q -> q .limit (1 ).sortBy ( Sort . by ( "firstName" ). descending ()). scroll (ScrollPosition .offset (1 )))
221
221
.as (StepVerifier ::create )
222
222
.expectNextMatches (peopleWindow -> {
223
223
assertThat (peopleWindow .getContent ()).extracting (Person ::getFirstName )
@@ -235,7 +235,7 @@ void scrollByExampleWithContinuingOffset(@Autowired QueryDSLPersonRepository rep
235
235
Predicate predicate = Expressions .predicate (Ops .EQ , firstNamePath , Expressions .asString ("Helge" ))
236
236
.or (Expressions .predicate (Ops .EQ , lastNamePath , Expressions .asString ("B." )));
237
237
238
- repository .findBy (predicate , q -> q .limit (1 ).scroll (ScrollPosition .offset (0 )))
238
+ repository .findBy (predicate , q -> q .limit (1 ).sortBy ( Sort . by ( "firstName" ). descending ()). scroll (ScrollPosition .offset (0 )))
239
239
.as (StepVerifier ::create )
240
240
.expectNextMatches (peopleWindow -> {
241
241
ScrollPosition currentPosition = peopleWindow .positionAt (peopleWindow .getContent ().get (0 ));
0 commit comments