@@ -196,7 +196,7 @@ void scrollByExampleWithNoOffset(@Autowired QueryDSLPersonRepository repository)
196196 Predicate predicate = Expressions .predicate (Ops .EQ , firstNamePath , Expressions .asString ("Helge" ))
197197 .or (Expressions .predicate (Ops .EQ , lastNamePath , Expressions .asString ("B." )));
198198
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 )))
200200 .as (StepVerifier ::create )
201201 .expectNextMatches (peopleWindow -> {
202202
@@ -217,7 +217,7 @@ void scrollByExampleWithOffset(@Autowired QueryDSLPersonRepository repository) {
217217 Predicate predicate = Expressions .predicate (Ops .EQ , firstNamePath , Expressions .asString ("Helge" ))
218218 .or (Expressions .predicate (Ops .EQ , lastNamePath , Expressions .asString ("B." )));
219219
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 )))
221221 .as (StepVerifier ::create )
222222 .expectNextMatches (peopleWindow -> {
223223 assertThat (peopleWindow .getContent ()).extracting (Person ::getFirstName )
@@ -235,7 +235,7 @@ void scrollByExampleWithContinuingOffset(@Autowired QueryDSLPersonRepository rep
235235 Predicate predicate = Expressions .predicate (Ops .EQ , firstNamePath , Expressions .asString ("Helge" ))
236236 .or (Expressions .predicate (Ops .EQ , lastNamePath , Expressions .asString ("B." )));
237237
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 )))
239239 .as (StepVerifier ::create )
240240 .expectNextMatches (peopleWindow -> {
241241 ScrollPosition currentPosition = peopleWindow .positionAt (peopleWindow .getContent ().get (0 ));
0 commit comments