@@ -100,6 +100,7 @@ public void testProcessRelationSupport() throws Exception {
100
100
client ().prepareSearch ("test" )
101
101
.setQuery (QueryBuilders .geoShapeQuery (defaultGeoFieldName , rectangle ).relation (shapeRelation ))
102
102
.get ();
103
+ fail ("Expected " + shapeRelation + " query relation not supported for Field [" + defaultGeoFieldName + "]" );
103
104
} catch (SearchPhaseExecutionException e ) {
104
105
assertThat (
105
106
e .getCause ().getMessage (),
@@ -119,6 +120,7 @@ public void testQueryLine() throws Exception {
119
120
120
121
try {
121
122
client ().prepareSearch ("test" ).setQuery (QueryBuilders .geoShapeQuery (defaultGeoFieldName , line )).get ();
123
+ fail ("Expected field [" + defaultGeoFieldName + "] does not support LINEARRING queries" );
122
124
} catch (SearchPhaseExecutionException e ) {
123
125
assertThat (e .getCause ().getMessage (), containsString ("does not support " + GeoShapeType .LINESTRING + " queries" ));
124
126
}
@@ -138,6 +140,7 @@ public void testQueryLinearRing() throws Exception {
138
140
searchRequestBuilder .setQuery (queryBuilder );
139
141
searchRequestBuilder .setIndices ("test" );
140
142
searchRequestBuilder .get ();
143
+ fail ("Expected field [" + defaultGeoFieldName + "] does not support LINEARRING queries" );
141
144
} catch (SearchPhaseExecutionException e ) {
142
145
assertThat (
143
146
e .getCause ().getMessage (),
@@ -160,6 +163,7 @@ public void testQueryMultiLine() throws Exception {
160
163
161
164
try {
162
165
client ().prepareSearch ("test" ).setQuery (QueryBuilders .geoShapeQuery (defaultGeoFieldName , multiline )).get ();
166
+ fail ("Expected field [" + defaultGeoFieldName + "] does not support " + GeoShapeType .MULTILINESTRING + " queries" );
163
167
} catch (Exception e ) {
164
168
assertThat (e .getCause ().getMessage (), containsString ("does not support " + GeoShapeType .MULTILINESTRING + " queries" ));
165
169
}
@@ -175,6 +179,7 @@ public void testQueryMultiPoint() throws Exception {
175
179
176
180
try {
177
181
client ().prepareSearch ("test" ).setQuery (QueryBuilders .geoShapeQuery (defaultGeoFieldName , multiPoint )).get ();
182
+ fail ("Expected field [" + defaultGeoFieldName + "] does not support " + GeoShapeType .MULTIPOINT + " queries" );
178
183
} catch (Exception e ) {
179
184
assertThat (e .getCause ().getMessage (), containsString ("does not support " + GeoShapeType .MULTIPOINT + " queries" ));
180
185
}
@@ -190,6 +195,7 @@ public void testQueryPoint() throws Exception {
190
195
191
196
try {
192
197
client ().prepareSearch ("test" ).setQuery (QueryBuilders .geoShapeQuery (defaultGeoFieldName , point )).get ();
198
+ fail ("Expected field [" + defaultGeoFieldName + "] does not support " + GeoShapeType .POINT + " queries" );
193
199
} catch (Exception e ) {
194
200
assertThat (e .getCause ().getMessage (), containsString ("does not support " + GeoShapeType .POINT + " queries" ));
195
201
}
0 commit comments