Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d08003d

Browse files
committedMar 21, 2024··
Expect tasks to fail.
Signed-off-by: dblock <dblock@amazon.com>
1 parent 7fc4fb0 commit d08003d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎server/src/test/java/org/opensearch/search/geo/GeoPointShapeQueryTests.java

+6
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public void testProcessRelationSupport() throws Exception {
100100
client().prepareSearch("test")
101101
.setQuery(QueryBuilders.geoShapeQuery(defaultGeoFieldName, rectangle).relation(shapeRelation))
102102
.get();
103+
fail("Expected " + shapeRelation + " query relation not supported for Field [" + defaultGeoFieldName + "]");
103104
} catch (SearchPhaseExecutionException e) {
104105
assertThat(
105106
e.getCause().getMessage(),
@@ -119,6 +120,7 @@ public void testQueryLine() throws Exception {
119120

120121
try {
121122
client().prepareSearch("test").setQuery(QueryBuilders.geoShapeQuery(defaultGeoFieldName, line)).get();
123+
fail("Expected field [" + defaultGeoFieldName + "] does not support LINEARRING queries");
122124
} catch (SearchPhaseExecutionException e) {
123125
assertThat(e.getCause().getMessage(), containsString("does not support " + GeoShapeType.LINESTRING + " queries"));
124126
}
@@ -138,6 +140,7 @@ public void testQueryLinearRing() throws Exception {
138140
searchRequestBuilder.setQuery(queryBuilder);
139141
searchRequestBuilder.setIndices("test");
140142
searchRequestBuilder.get();
143+
fail("Expected field [" + defaultGeoFieldName + "] does not support LINEARRING queries");
141144
} catch (SearchPhaseExecutionException e) {
142145
assertThat(
143146
e.getCause().getMessage(),
@@ -160,6 +163,7 @@ public void testQueryMultiLine() throws Exception {
160163

161164
try {
162165
client().prepareSearch("test").setQuery(QueryBuilders.geoShapeQuery(defaultGeoFieldName, multiline)).get();
166+
fail("Expected field [" + defaultGeoFieldName + "] does not support " + GeoShapeType.MULTILINESTRING + " queries");
163167
} catch (Exception e) {
164168
assertThat(e.getCause().getMessage(), containsString("does not support " + GeoShapeType.MULTILINESTRING + " queries"));
165169
}
@@ -175,6 +179,7 @@ public void testQueryMultiPoint() throws Exception {
175179

176180
try {
177181
client().prepareSearch("test").setQuery(QueryBuilders.geoShapeQuery(defaultGeoFieldName, multiPoint)).get();
182+
fail("Expected field [" + defaultGeoFieldName + "] does not support " + GeoShapeType.MULTIPOINT + " queries");
178183
} catch (Exception e) {
179184
assertThat(e.getCause().getMessage(), containsString("does not support " + GeoShapeType.MULTIPOINT + " queries"));
180185
}
@@ -190,6 +195,7 @@ public void testQueryPoint() throws Exception {
190195

191196
try {
192197
client().prepareSearch("test").setQuery(QueryBuilders.geoShapeQuery(defaultGeoFieldName, point)).get();
198+
fail("Expected field [" + defaultGeoFieldName + "] does not support " + GeoShapeType.POINT + " queries");
193199
} catch (Exception e) {
194200
assertThat(e.getCause().getMessage(), containsString("does not support " + GeoShapeType.POINT + " queries"));
195201
}

0 commit comments

Comments
 (0)
Please sign in to comment.