Skip to content

Commit

Permalink
Expect tasks to fail.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Mar 21, 2024
1 parent 7fc4fb0 commit d08003d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public void testProcessRelationSupport() throws Exception {
client().prepareSearch("test")
.setQuery(QueryBuilders.geoShapeQuery(defaultGeoFieldName, rectangle).relation(shapeRelation))
.get();
fail("Expected " + shapeRelation + " query relation not supported for Field [" + defaultGeoFieldName + "]");
} catch (SearchPhaseExecutionException e) {
assertThat(
e.getCause().getMessage(),
Expand All @@ -119,6 +120,7 @@ public void testQueryLine() throws Exception {

try {
client().prepareSearch("test").setQuery(QueryBuilders.geoShapeQuery(defaultGeoFieldName, line)).get();
fail("Expected field [" + defaultGeoFieldName + "] does not support LINEARRING queries");
} catch (SearchPhaseExecutionException e) {
assertThat(e.getCause().getMessage(), containsString("does not support " + GeoShapeType.LINESTRING + " queries"));
}
Expand All @@ -138,6 +140,7 @@ public void testQueryLinearRing() throws Exception {
searchRequestBuilder.setQuery(queryBuilder);
searchRequestBuilder.setIndices("test");
searchRequestBuilder.get();
fail("Expected field [" + defaultGeoFieldName + "] does not support LINEARRING queries");
} catch (SearchPhaseExecutionException e) {
assertThat(
e.getCause().getMessage(),
Expand All @@ -160,6 +163,7 @@ public void testQueryMultiLine() throws Exception {

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

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

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

0 comments on commit d08003d

Please sign in to comment.