15
15
*/
16
16
package org .springframework .data .gemfire .repository .support ;
17
17
18
- import static java .util .Arrays .*;
19
- import static org .assertj .core .api .Assertions .*;
18
+ import static org .assertj .core .api .Assertions .assertThat ;
20
19
20
+ import java .util .Arrays ;
21
21
import java .util .Collections ;
22
22
import java .util .List ;
23
23
24
24
import javax .annotation .Resource ;
25
25
26
+ import org .junit .Before ;
27
+ import org .junit .Test ;
28
+ import org .junit .runner .RunWith ;
29
+
26
30
import org .apache .geode .cache .GemFireCache ;
27
31
import org .apache .geode .cache .Region ;
28
32
import org .apache .geode .cache .RegionEvent ;
29
33
import org .apache .geode .cache .query .SelectResults ;
30
34
import org .apache .geode .cache .util .CacheListenerAdapter ;
31
- import org .junit .Before ;
32
- import org .junit .Test ;
33
- import org .junit .runner .RunWith ;
35
+
34
36
import org .springframework .beans .factory .annotation .Autowired ;
35
37
import org .springframework .context .annotation .Bean ;
36
38
import org .springframework .data .domain .Page ;
@@ -111,7 +113,7 @@ public void findAllPaged() {
111
113
112
114
assertThat (this .repository .count ()).isEqualTo (0 );
113
115
114
- List <Person > people = asList (new Person (1L , "Jon" , "Doe" ), new Person (2L , "Jane" , "Doe" ),
116
+ List <Person > people = Arrays . asList (new Person (1L , "Jon" , "Doe" ), new Person (2L , "Jane" , "Doe" ),
115
117
new Person (3L , "Cookie" , "Doe" ), new Person (4L , "Pie" , "Doe" ), new Person (5L , "Sour" , "Doe" ));
116
118
117
119
people .forEach (person -> this .template .put (person .getId (), person ));
@@ -156,17 +158,17 @@ public void findAllWithIds() {
156
158
this .template .put (carter .getId (), carter );
157
159
this .template .put (leroi .getId (), leroi );
158
160
159
- Iterable <Person > result = this .repository .findAllById (asList (carter .getId (), leroi .getId ()));
161
+ Iterable <Person > result = this .repository .findAllById (Arrays . asList (carter .getId (), leroi .getId ()));
160
162
161
163
assertThat (result ).isNotNull ();
162
164
assertThat (result ).hasSize (2 );
163
- assertThat (result ).containsAll (asList (carter , leroi ));
165
+ assertThat (result ).containsAll (Arrays . asList (carter , leroi ));
164
166
}
165
167
166
168
@ Test
167
169
public void findAllWithIdsReturnsNoMatches () {
168
170
169
- Iterable <Person > results = this .repository .findAllById (asList (1L , 2L ));
171
+ Iterable <Person > results = this .repository .findAllById (Arrays . asList (1L , 2L ));
170
172
171
173
assertThat (results ).isNotNull ();
172
174
assertThat (results ).isEmpty ();
@@ -182,7 +184,7 @@ public void findAllWithIdsReturnsPartialMatches() {
182
184
this .template .put (kurt .getId (), kurt );
183
185
this .template .put (eddie .getId (), eddie );
184
186
185
- Iterable <Person > results = this .repository .findAllById (asList (0L , 1L , 2L , 4L ));
187
+ Iterable <Person > results = this .repository .findAllById (Arrays . asList (0L , 1L , 2L , 4L ));
186
188
187
189
assertThat (results ).isNotNull ();
188
190
assertThat (results ).hasSize (2 );
@@ -226,14 +228,14 @@ public void deleteAllById() {
226
228
227
229
assertThat (this .repository .count ()).isEqualTo (0 );
228
230
229
- List <Person > people = asList (new Person (1L , "Jon" , "Doe" ), new Person (2L , "Jane" , "Doe" ),
231
+ List <Person > people = Arrays . asList (new Person (1L , "Jon" , "Doe" ), new Person (2L , "Jane" , "Doe" ),
230
232
new Person (3L , "Cookie" , "Doe" ), new Person (4L , "Pie" , "Doe" ), new Person (5L , "Sour" , "Doe" ));
231
233
232
234
people .forEach (person -> this .template .put (person .getId (), person ));
233
235
234
236
assertThat (this .repository .count ()).isEqualTo (5 );
235
237
236
- this .repository .deleteAllById (asList (1L , 2L ));
238
+ this .repository .deleteAllById (Arrays . asList (1L , 2L ));
237
239
238
240
assertThat (this .repository .count ()).isEqualTo (3L );
239
241
assertThat (this .repository .findAll ()) //
@@ -250,7 +252,7 @@ public void saveEntities() {
250
252
Person jonBloom = new Person (2L , "Jon" , "Bloom" );
251
253
Person juanBlume = new Person (3L , "Juan" , "Blume" );
252
254
253
- this .repository .saveAll (asList (johnBlum , jonBloom , juanBlume ));
255
+ this .repository .saveAll (Arrays . asList (johnBlum , jonBloom , juanBlume ));
254
256
255
257
assertThat (this .template .getRegion ().size ()).isEqualTo (3 );
256
258
assertThat ((Person ) this .template .get (johnBlum .getId ())).isEqualTo (johnBlum );
0 commit comments