@@ -137,15 +137,15 @@ void scrollByExampleWithNoOffset(@Autowired QueryDSLPersonRepository repository)
137
137
Predicate predicate = Expressions .predicate (Ops .EQ , firstNamePath , Expressions .asString ("Helge" ))
138
138
.or (Expressions .predicate (Ops .EQ , lastNamePath , Expressions .asString ("B." )));
139
139
140
- Window <Person > peopleWindow = repository .findBy (predicate , q -> q .limit (1 ).sortBy (Sort .by ("firstName" ).descending ()).scroll (ScrollPosition .offset (0 )));
140
+ Window <Person > peopleWindow = repository .findBy (predicate , q -> q .limit (1 ).sortBy (Sort .by ("firstName" ).descending ()).scroll (ScrollPosition .offset ()));
141
141
142
142
assertThat (peopleWindow .getContent ()).extracting (Person ::getFirstName )
143
143
.containsExactlyInAnyOrder ("Helge" );
144
144
145
145
assertThat (peopleWindow .isLast ()).isFalse ();
146
146
assertThat (peopleWindow .hasNext ()).isTrue ();
147
147
148
- assertThat (peopleWindow .positionAt (peopleWindow .getContent ().get (0 ))).isEqualTo (ScrollPosition .offset (1 ));
148
+ assertThat (peopleWindow .positionAt (peopleWindow .getContent ().get (0 ))).isEqualTo (ScrollPosition .offset (0 ));
149
149
}
150
150
151
151
@ Test
@@ -154,14 +154,14 @@ void scrollByExampleWithOffset(@Autowired QueryDSLPersonRepository repository) {
154
154
Predicate predicate = Expressions .predicate (Ops .EQ , firstNamePath , Expressions .asString ("Helge" ))
155
155
.or (Expressions .predicate (Ops .EQ , lastNamePath , Expressions .asString ("B." )));
156
156
157
- Window <Person > peopleWindow = repository .findBy (predicate , q -> q .limit (1 ).sortBy (Sort .by ("firstName" ).descending ()).scroll (ScrollPosition .offset (1 )));
157
+ Window <Person > peopleWindow = repository .findBy (predicate , q -> q .limit (1 ).sortBy (Sort .by ("firstName" ).descending ()).scroll (ScrollPosition .offset (0 )));
158
158
159
159
assertThat (peopleWindow .getContent ()).extracting (Person ::getFirstName )
160
160
.containsExactlyInAnyOrder ("Bela" );
161
161
162
162
assertThat (peopleWindow .isLast ()).isTrue ();
163
163
164
- assertThat (peopleWindow .positionAt (peopleWindow .getContent ().get (0 ))).isEqualTo (ScrollPosition .offset (2 ));
164
+ assertThat (peopleWindow .positionAt (peopleWindow .getContent ().get (0 ))).isEqualTo (ScrollPosition .offset (1 ));
165
165
}
166
166
167
167
@ Test
@@ -170,7 +170,7 @@ void scrollByExampleWithContinuingOffset(@Autowired QueryDSLPersonRepository rep
170
170
Predicate predicate = Expressions .predicate (Ops .EQ , firstNamePath , Expressions .asString ("Helge" ))
171
171
.or (Expressions .predicate (Ops .EQ , lastNamePath , Expressions .asString ("B." )));
172
172
173
- Window <Person > peopleWindow = repository .findBy (predicate , q -> q .limit (1 ).sortBy (Sort .by ("firstName" ).descending ()).scroll (ScrollPosition .offset (0 )));
173
+ Window <Person > peopleWindow = repository .findBy (predicate , q -> q .limit (1 ).sortBy (Sort .by ("firstName" ).descending ()).scroll (ScrollPosition .offset ()));
174
174
ScrollPosition currentPosition = peopleWindow .positionAt (peopleWindow .getContent ().get (0 ));
175
175
peopleWindow = repository .findBy (predicate , q -> q .limit (1 ).scroll (currentPosition ));
176
176
0 commit comments