@@ -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,13 +140,12 @@ 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 (),
144
147
containsString ("Field [" + defaultGeoFieldName + "] does not support LINEARRING queries" )
145
148
);
146
- } catch (UnsupportedOperationException e ) {
147
- assertThat (e .getMessage (), containsString ("line ring cannot be serialized using GeoJson" ));
148
149
}
149
150
}
150
151
@@ -162,6 +163,7 @@ public void testQueryMultiLine() throws Exception {
162
163
163
164
try {
164
165
client ().prepareSearch ("test" ).setQuery (QueryBuilders .geoShapeQuery (defaultGeoFieldName , multiline )).get ();
166
+ fail ("Expected field [" + defaultGeoFieldName + "] does not support " + GeoShapeType .MULTILINESTRING + " queries" );
165
167
} catch (Exception e ) {
166
168
assertThat (e .getCause ().getMessage (), containsString ("does not support " + GeoShapeType .MULTILINESTRING + " queries" ));
167
169
}
@@ -177,6 +179,7 @@ public void testQueryMultiPoint() throws Exception {
177
179
178
180
try {
179
181
client ().prepareSearch ("test" ).setQuery (QueryBuilders .geoShapeQuery (defaultGeoFieldName , multiPoint )).get ();
182
+ fail ("Expected field [" + defaultGeoFieldName + "] does not support " + GeoShapeType .MULTIPOINT + " queries" );
180
183
} catch (Exception e ) {
181
184
assertThat (e .getCause ().getMessage (), containsString ("does not support " + GeoShapeType .MULTIPOINT + " queries" ));
182
185
}
@@ -192,6 +195,7 @@ public void testQueryPoint() throws Exception {
192
195
193
196
try {
194
197
client ().prepareSearch ("test" ).setQuery (QueryBuilders .geoShapeQuery (defaultGeoFieldName , point )).get ();
198
+ fail ("Expected field [" + defaultGeoFieldName + "] does not support " + GeoShapeType .POINT + " queries" );
195
199
} catch (Exception e ) {
196
200
assertThat (e .getCause ().getMessage (), containsString ("does not support " + GeoShapeType .POINT + " queries" ));
197
201
}
0 commit comments