From 33c8625210a7691d7439d3df351bd771fe72b2a5 Mon Sep 17 00:00:00 2001 From: Clement Escoffier Date: Wed, 14 Sep 2022 10:16:47 +0200 Subject: [PATCH] Change visilibility of GeoSearchArgs.fromMember(...) to public --- .../quarkus/redis/datasource/geo/GeoSearchArgs.java | 2 +- .../io/quarkus/redis/datasource/GeoCommandsTest.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/geo/GeoSearchArgs.java b/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/geo/GeoSearchArgs.java index 2070507f362c3..29b2cd9140f56 100644 --- a/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/geo/GeoSearchArgs.java +++ b/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/geo/GeoSearchArgs.java @@ -56,7 +56,7 @@ public GeoSearchArgs fromMember(V member) { * @param latitude the latitude * @return the current {@code GeoSearchArgs} */ - private GeoSearchArgs fromCoordinate(double longitude, double latitude) { + public GeoSearchArgs fromCoordinate(double longitude, double latitude) { this.longitude = longitude; this.latitude = latitude; return this; diff --git a/extensions/redis-client/runtime/src/test/java/io/quarkus/redis/datasource/GeoCommandsTest.java b/extensions/redis-client/runtime/src/test/java/io/quarkus/redis/datasource/GeoCommandsTest.java index 0d2a365de53ae..ea34b4ef21c71 100644 --- a/extensions/redis-client/runtime/src/test/java/io/quarkus/redis/datasource/GeoCommandsTest.java +++ b/extensions/redis-client/runtime/src/test/java/io/quarkus/redis/datasource/GeoCommandsTest.java @@ -494,6 +494,17 @@ void geosearchWithArgs() { assertThat(gv.geohash).isEmpty(); }); + args = new GeoSearchArgs().fromCoordinate(CRUSSOL_LONGITUDE, CRUSSOL_LATITUDE) + .byRadius(5, GeoUnit.KM).withCoordinates().withDistance().descending(); + places = geo.geosearch(key, args); + assertThat(places).hasSize(1).allSatisfy(gv -> { + assertThat(gv.member).isEqualTo(Place.crussol); + assertThat(gv.longitude).isNotEmpty(); + assertThat(gv.latitude).isNotEmpty(); + assertThat(gv.distance).isNotEmpty(); + assertThat(gv.geohash).isEmpty(); + }); + } @Test