6
6
import static org .hamcrest .Matchers .contains ;
7
7
import static org .hamcrest .Matchers .containsInAnyOrder ;
8
8
import static org .hamcrest .Matchers .equalTo ;
9
- import static org .hamcrest .Matchers .instanceOf ;
10
9
import static org .hamcrest .Matchers .nullValue ;
11
10
import static org .junit .Assert .assertEquals ;
12
- import static redis .clients .jedis .util .GeoCoordinateMatcher .atCoordinates ;
11
+ import static redis .clients .jedis .util .GeoCoordinateMatcher .isEqualWithTolerance ;
13
12
14
13
import java .util .HashMap ;
15
14
import java .util .List ;
23
22
import redis .clients .jedis .RedisProtocol ;
24
23
import redis .clients .jedis .Response ;
25
24
import redis .clients .jedis .args .GeoUnit ;
26
- import redis .clients .jedis .exceptions .JedisDataException ;
27
25
import redis .clients .jedis .params .GeoAddParams ;
28
26
import redis .clients .jedis .params .GeoRadiusParam ;
29
27
import redis .clients .jedis .params .GeoRadiusStoreParam ;
@@ -181,14 +179,14 @@ public void geopos() {
181
179
pipe .sync ();
182
180
183
181
assertThat (coordinates .get (), contains (
184
- atCoordinates (3.0 , 4.0 ),
185
- atCoordinates (2.0 , 3.0 ),
182
+ isEqualWithTolerance (3.0 , 4.0 ),
183
+ isEqualWithTolerance (2.0 , 3.0 ),
186
184
null
187
185
));
188
186
189
187
assertThat (bcoordinates .get (), contains (
190
- atCoordinates (3.0 , 4.0 ),
191
- atCoordinates (2.0 , 3.0 ),
188
+ isEqualWithTolerance (3.0 , 4.0 ),
189
+ isEqualWithTolerance (2.0 , 3.0 ),
192
190
null
193
191
));
194
192
}
@@ -257,7 +255,7 @@ public void georadius() {
257
255
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
258
256
contains (closeTo (56.4413 , EPSILON )));
259
257
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
260
- contains (atCoordinates (15.087269 , 37.502669 )));
258
+ contains (isEqualWithTolerance (15.087269 , 37.502669 )));
261
259
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
262
260
contains (3479447370796909L ));
263
261
@@ -356,7 +354,7 @@ public void georadiusReadonly() {
356
354
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
357
355
contains (closeTo (56.4413 , EPSILON )));
358
356
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
359
- contains (atCoordinates (15.087269 , 37.502669 )));
357
+ contains (isEqualWithTolerance (15.087269 , 37.502669 )));
360
358
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
361
359
contains (0L ));
362
360
}
@@ -417,7 +415,7 @@ public void georadiusBinary() {
417
415
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
418
416
contains (closeTo (56.4413 , EPSILON )));
419
417
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
420
- contains (atCoordinates (15.087269 , 37.502669 )));
418
+ contains (isEqualWithTolerance (15.087269 , 37.502669 )));
421
419
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
422
420
contains (0L ));
423
421
}
@@ -498,7 +496,7 @@ public void georadiusReadonlyBinary() {
498
496
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
499
497
contains (closeTo (56.4413 , EPSILON )));
500
498
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
501
- contains (atCoordinates (15.087269 , 37.502669 )));
499
+ contains (isEqualWithTolerance (15.087269 , 37.502669 )));
502
500
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
503
501
contains (0L ));
504
502
}
@@ -543,7 +541,7 @@ public void georadiusByMember() {
543
541
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
544
542
contains (closeTo (0.0 , EPSILON )));
545
543
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
546
- contains (atCoordinates (13.583333 , 37.316667 )));
544
+ contains (isEqualWithTolerance (13.583333 , 37.316667 )));
547
545
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
548
546
contains (0L ));
549
547
}
@@ -606,7 +604,7 @@ public void georadiusByMemberReadonly() {
606
604
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
607
605
contains (closeTo (0.0 , EPSILON )));
608
606
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
609
- contains (atCoordinates (13.583333 , 37.316667 )));
607
+ contains (isEqualWithTolerance (13.583333 , 37.316667 )));
610
608
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
611
609
contains (0L ));
612
610
}
@@ -650,7 +648,7 @@ public void georadiusByMemberBinary() {
650
648
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
651
649
contains (closeTo (0.0 , EPSILON )));
652
650
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
653
- contains (atCoordinates (13.583333 , 37.316667 )));
651
+ contains (isEqualWithTolerance (13.583333 , 37.316667 )));
654
652
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
655
653
contains (0L ));
656
654
}
@@ -712,7 +710,7 @@ public void georadiusByMemberReadonlyBinary() {
712
710
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
713
711
contains (closeTo (0.0 , EPSILON )));
714
712
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
715
- contains (atCoordinates (13.583333 , 37.316667 )));
713
+ contains (isEqualWithTolerance (13.583333 , 37.316667 )));
716
714
assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
717
715
contains (0L ));
718
716
}
@@ -775,7 +773,7 @@ public void geosearch() {
775
773
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
776
774
contains (closeTo (0.0 , EPSILON ), closeTo (3.0674 , EPSILON )));
777
775
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
778
- contains (atCoordinates (2.1909389952632d , 41.433791470673d ), atCoordinates (2.1873744593677d , 41.406342043777d )));
776
+ contains (isEqualWithTolerance (2.1909389952632d , 41.433791470673d ), isEqualWithTolerance (2.1873744593677d , 41.406342043777d )));
779
777
assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
780
778
contains (3471609698139488L , 3471609625421029L ));
781
779
@@ -793,7 +791,7 @@ public void geosearch() {
793
791
assertThat (members8 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
794
792
contains (closeTo (0.0881 , EPSILON )));
795
793
assertThat (members8 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
796
- contains (atCoordinates (2.1909389952632d , 41.433791470673d )));
794
+ contains (isEqualWithTolerance (2.1909389952632d , 41.433791470673d )));
797
795
assertThat (members8 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
798
796
contains (0L ));
799
797
}
0 commit comments