Skip to content

Commit 5b8b981

Browse files
authored
Fix failure on GeoShapeQueryTestCase#testRandomGeoCollectionQuery (#87916) (#87919)
Use the safer GeometryTestUtils instead of Lucene GeoTestUtil to generate random polygons.
1 parent 0d8412a commit 5b8b981

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeQueryTestCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ public void testShapeFetchingPath() throws Exception {
157157
public void testRandomGeoCollectionQuery() throws Exception {
158158
// Create a random geometry collection to index.
159159
GeometryCollection<Geometry> randomIndexCollection = GeometryTestUtils.randomGeometryCollectionWithoutCircle(false);
160-
org.apache.lucene.geo.Polygon randomPoly = GeoTestUtil.nextPolygon();
161-
Polygon polygon = new Polygon(new LinearRing(randomPoly.getPolyLons(), randomPoly.getPolyLats()));
160+
Polygon polygon = GeometryTestUtils.randomPolygon(false);
162161
List<Geometry> indexGeometries = new ArrayList<>();
163162
for (Geometry geometry : randomIndexCollection) {
164163
indexGeometries.add(geometry);

0 commit comments

Comments
 (0)