@@ -77,10 +77,12 @@ protected GeoShapeQueryBuilder doCreateTestQueryBuilder() {
77
77
builder .indexedShapePath (indexedShapePath );
78
78
}
79
79
}
80
- SpatialStrategy strategy = randomFrom (SpatialStrategy .values ());
81
- builder .strategy (strategy );
82
- if (strategy != SpatialStrategy .TERM ) {
83
- builder .relation (randomFrom (ShapeRelation .values ()));
80
+ if (randomBoolean ()) {
81
+ SpatialStrategy strategy = randomFrom (SpatialStrategy .values ());
82
+ builder .strategy (strategy );
83
+ if (strategy != SpatialStrategy .TERM ) {
84
+ builder .relation (randomFrom (ShapeRelation .values ()));
85
+ }
84
86
}
85
87
return builder ;
86
88
}
@@ -105,9 +107,7 @@ protected GetResponse executeGet(GetRequest getRequest) {
105
107
} catch (IOException ex ) {
106
108
throw new ElasticsearchException ("boom" , ex );
107
109
}
108
- GetResponse response = new GetResponse (new GetResult (indexedShapeIndex , indexedShapeType , indexedShapeId , 0 , true , new BytesArray (
109
- json ), null ));
110
- return response ;
110
+ return new GetResponse (new GetResult (indexedShapeIndex , indexedShapeType , indexedShapeId , 0 , true , new BytesArray (json ), null ));
111
111
}
112
112
113
113
@ After
@@ -149,7 +149,7 @@ public void testNoFieldName() throws Exception {
149
149
@ Test
150
150
public void testNoShape () throws IOException {
151
151
try {
152
- GeoShapeQueryBuilder builder = new GeoShapeQueryBuilder (GEO_SHAPE_FIELD_NAME , (ShapeBuilder ) null );
152
+ new GeoShapeQueryBuilder (GEO_SHAPE_FIELD_NAME , (ShapeBuilder ) null );
153
153
fail ("exception expected" );
154
154
} catch (IllegalArgumentException e ) {
155
155
// expected
@@ -158,12 +158,12 @@ public void testNoShape() throws IOException {
158
158
159
159
@ Test (expected = IllegalArgumentException .class )
160
160
public void testNoIndexedShape () throws IOException {
161
- new GeoShapeQueryBuilder (GEO_SHAPE_FIELD_NAME , ( String ) null , "type" );
161
+ new GeoShapeQueryBuilder (GEO_SHAPE_FIELD_NAME , null , "type" );
162
162
}
163
163
164
164
@ Test (expected = IllegalArgumentException .class )
165
165
public void testNoIndexedShapeType () throws IOException {
166
- new GeoShapeQueryBuilder (GEO_SHAPE_FIELD_NAME , "id" , ( String ) null );
166
+ new GeoShapeQueryBuilder (GEO_SHAPE_FIELD_NAME , "id" , null );
167
167
}
168
168
169
169
@ Test (expected =IllegalArgumentException .class )
0 commit comments