28
28
29
29
import org .junit .jupiter .api .BeforeEach ;
30
30
import org .junit .jupiter .api .Test ;
31
-
32
31
import org .springframework .beans .factory .annotation .Autowired ;
33
32
import org .springframework .boot .autoconfigure .EnableAutoConfiguration ;
34
33
import org .springframework .boot .test .autoconfigure .orm .jpa .DataJpaTest ;
41
40
import org .springframework .data .domain .ScrollPosition ;
42
41
import org .springframework .data .domain .Slice ;
43
42
import org .springframework .data .domain .Window ;
44
- import org .springframework .data .domain .WindowIterator ;
43
+ import org .springframework .data .support .WindowIterator ;
45
44
import org .springframework .data .util .Streamable ;
46
45
47
46
import com .github .javafaker .Faker ;
@@ -124,7 +123,7 @@ void sliceThroughResultsWithSkipAndLimit() {
124
123
void scrollThroughResultsWithSkipAndLimit () {
125
124
126
125
Window <Book > window ;
127
- ScrollPosition scrollPosition = OffsetScrollPosition . initial ();
126
+ ScrollPosition scrollPosition = ScrollPosition . offset ();
128
127
129
128
do {
130
129
@@ -146,7 +145,7 @@ void scrollThroughResultsUsingWindowIteratorWithSkipAndLimit() {
146
145
147
146
WindowIterator <Book > iterator = WindowIterator
148
147
.of (scrollPosition -> books .findTop2ByTitleContainsOrderByPublicationDate ("the-crazy-book-" , scrollPosition ))
149
- .startingAt (OffsetScrollPosition . initial ());
148
+ .startingAt (ScrollPosition . offset ());
150
149
151
150
List <Book > allBooks = Streamable .of (() -> iterator ).stream ().toList ();
152
151
assertThat (allBooks ).hasSize (50 );
@@ -162,7 +161,7 @@ void scrollThroughResultsUsingWindowIteratorWithSkipAndLimit() {
162
161
void scrollThroughResultsWithKeyset () {
163
162
164
163
Window <Book > window ;
165
- ScrollPosition scrollPosition = KeysetScrollPosition . initial ();
164
+ ScrollPosition scrollPosition = ScrollPosition . keyset ();
166
165
do {
167
166
168
167
window = books .findTop2ByTitleContainsOrderByPublicationDate ("the" , scrollPosition );
0 commit comments