66import static org .hamcrest .Matchers .contains ;
77import static org .hamcrest .Matchers .containsInAnyOrder ;
88import static org .hamcrest .Matchers .equalTo ;
9- import static org .hamcrest .Matchers .instanceOf ;
109import static org .hamcrest .Matchers .nullValue ;
1110import static org .junit .Assert .assertEquals ;
12- import static redis .clients .jedis .util .GeoCoordinateMatcher .atCoordinates ;
11+ import static redis .clients .jedis .util .GeoCoordinateMatcher .isEqualWithTolerance ;
1312
1413import java .util .HashMap ;
1514import java .util .List ;
2322import redis .clients .jedis .RedisProtocol ;
2423import redis .clients .jedis .Response ;
2524import redis .clients .jedis .args .GeoUnit ;
26- import redis .clients .jedis .exceptions .JedisDataException ;
2725import redis .clients .jedis .params .GeoAddParams ;
2826import redis .clients .jedis .params .GeoRadiusParam ;
2927import redis .clients .jedis .params .GeoRadiusStoreParam ;
@@ -181,14 +179,14 @@ public void geopos() {
181179 pipe .sync ();
182180
183181 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 ),
186184 null
187185 ));
188186
189187 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 ),
192190 null
193191 ));
194192 }
@@ -257,7 +255,7 @@ public void georadius() {
257255 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
258256 contains (closeTo (56.4413 , EPSILON )));
259257 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
260- contains (atCoordinates (15.087269 , 37.502669 )));
258+ contains (isEqualWithTolerance (15.087269 , 37.502669 )));
261259 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
262260 contains (3479447370796909L ));
263261
@@ -356,7 +354,7 @@ public void georadiusReadonly() {
356354 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
357355 contains (closeTo (56.4413 , EPSILON )));
358356 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
359- contains (atCoordinates (15.087269 , 37.502669 )));
357+ contains (isEqualWithTolerance (15.087269 , 37.502669 )));
360358 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
361359 contains (0L ));
362360 }
@@ -417,7 +415,7 @@ public void georadiusBinary() {
417415 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
418416 contains (closeTo (56.4413 , EPSILON )));
419417 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
420- contains (atCoordinates (15.087269 , 37.502669 )));
418+ contains (isEqualWithTolerance (15.087269 , 37.502669 )));
421419 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
422420 contains (0L ));
423421 }
@@ -498,7 +496,7 @@ public void georadiusReadonlyBinary() {
498496 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
499497 contains (closeTo (56.4413 , EPSILON )));
500498 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
501- contains (atCoordinates (15.087269 , 37.502669 )));
499+ contains (isEqualWithTolerance (15.087269 , 37.502669 )));
502500 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
503501 contains (0L ));
504502 }
@@ -543,7 +541,7 @@ public void georadiusByMember() {
543541 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
544542 contains (closeTo (0.0 , EPSILON )));
545543 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
546- contains (atCoordinates (13.583333 , 37.316667 )));
544+ contains (isEqualWithTolerance (13.583333 , 37.316667 )));
547545 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
548546 contains (0L ));
549547 }
@@ -606,7 +604,7 @@ public void georadiusByMemberReadonly() {
606604 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
607605 contains (closeTo (0.0 , EPSILON )));
608606 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
609- contains (atCoordinates (13.583333 , 37.316667 )));
607+ contains (isEqualWithTolerance (13.583333 , 37.316667 )));
610608 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
611609 contains (0L ));
612610 }
@@ -650,7 +648,7 @@ public void georadiusByMemberBinary() {
650648 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
651649 contains (closeTo (0.0 , EPSILON )));
652650 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
653- contains (atCoordinates (13.583333 , 37.316667 )));
651+ contains (isEqualWithTolerance (13.583333 , 37.316667 )));
654652 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
655653 contains (0L ));
656654 }
@@ -712,7 +710,7 @@ public void georadiusByMemberReadonlyBinary() {
712710 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
713711 contains (closeTo (0.0 , EPSILON )));
714712 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
715- contains (atCoordinates (13.583333 , 37.316667 )));
713+ contains (isEqualWithTolerance (13.583333 , 37.316667 )));
716714 assertThat (members3 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
717715 contains (0L ));
718716 }
@@ -775,7 +773,7 @@ public void geosearch() {
775773 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
776774 contains (closeTo (0.0 , EPSILON ), closeTo (3.0674 , EPSILON )));
777775 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 )));
779777 assertThat (members4 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
780778 contains (3471609698139488L , 3471609625421029L ));
781779
@@ -793,7 +791,7 @@ public void geosearch() {
793791 assertThat (members8 .get ().stream ().map (GeoRadiusResponse ::getDistance ).collect (Collectors .toList ()),
794792 contains (closeTo (0.0881 , EPSILON )));
795793 assertThat (members8 .get ().stream ().map (GeoRadiusResponse ::getCoordinate ).collect (Collectors .toList ()),
796- contains (atCoordinates (2.1909389952632d , 41.433791470673d )));
794+ contains (isEqualWithTolerance (2.1909389952632d , 41.433791470673d )));
797795 assertThat (members8 .get ().stream ().map (GeoRadiusResponse ::getRawScore ).collect (Collectors .toList ()),
798796 contains (0L ));
799797 }
0 commit comments