Skip to content

Commit

Permalink
Fix integration test failures
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Singh <surajrider@gmail.com>
  • Loading branch information
dreamer-89 committed Mar 4, 2022
1 parent 769e64b commit 8899103
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void testIndexShapeRouting() throws Exception {
indexRandom(true, client().prepareIndex("test").setId("0").setSource(source, XContentType.JSON).setRouting("ABC"));

SearchResponse searchResponse = client().prepareSearch("test")
.setQuery(geoShapeQuery("shape", "0", "doc").indexedShapeIndex("test").indexedShapeRouting("ABC"))
.setQuery(geoShapeQuery("shape", "0").indexedShapeIndex("test").indexedShapeRouting("ABC"))
.get();

assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void testIndexShapeRouting() throws Exception {
indexRandom(true, client().prepareIndex("test").setId("0").setSource(source, XContentType.JSON).setRouting("ABC"));

SearchResponse searchResponse = client().prepareSearch("test")
.setQuery(geoShapeQuery("shape", "0", "doc").indexedShapeIndex("test").indexedShapeRouting("ABC"))
.setQuery(geoShapeQuery("shape", "0").indexedShapeIndex("test").indexedShapeRouting("ABC"))
.get();

assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.opensearch.common.geo.parsers.ShapeParser;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.logging.DeprecationLogger;
import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.geometry.Geometry;
Expand All @@ -61,8 +60,6 @@
*/
public class GeoShapeQueryBuilder extends AbstractGeometryQueryBuilder<GeoShapeQueryBuilder> {
public static final String NAME = "geo_shape";
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(GeoShapeQueryBuilder.class);

protected static final ParseField STRATEGY_FIELD = new ParseField("strategy");

private SpatialStrategy strategy;
Expand Down Expand Up @@ -96,18 +93,6 @@ public GeoShapeQueryBuilder(String fieldName, ShapeBuilder shape) {
super(fieldName, shape);
}

/**
* Creates a new GeoShapeQueryBuilder whose Query will be against the given
* field name and will use the Shape found with the given shape id and supplier
*
* @param fieldName
* Name of the field that will be filtered
* @param shapeSupplier A shape supplier
* @param indexedShapeId
* ID of the indexed Shape that will be used in the Query
* @deprecated use {@link #GeoShapeQueryBuilder(String, String)} instead
*/
@Deprecated
public GeoShapeQueryBuilder(String fieldName, Supplier<Geometry> shapeSupplier, String indexedShapeId) {
super(fieldName, shapeSupplier, indexedShapeId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ public void testNoShape() throws IOException {
}

public void testNoIndexedShape() throws IOException {
IllegalArgumentException e = expectThrows(
IllegalArgumentException.class,
() -> new GeoShapeQueryBuilder(fieldName(), null, "null")
);
IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new GeoShapeQueryBuilder(fieldName(), null, null));
assertEquals("either shape or indexedShapeId is required", e.getMessage());
}

Expand Down

0 comments on commit 8899103

Please sign in to comment.