Skip to content

Commit 8fd5915

Browse files
committed
expand test
1 parent 79f79c7 commit 8fd5915

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

server/src/test/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoHashGridParserTests.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,15 @@ public void testParseErrorOnPrecisionOutOfRange() throws Exception {
122122
fail();
123123
} catch (XContentParseException ex) {
124124
assertThat(ex.getCause(), instanceOf(IllegalArgumentException.class));
125-
if (type == GeoHashType.GEOHASH) {
126-
String expectedMsg;
127-
switch (type) {
128-
case GEOHASH:
129-
expectedMsg = "Invalid geohash aggregation precision of 13. Must be between 1 and 12.";
130-
break;
131-
default:
132-
throw new IllegalArgumentException("GeoHashType." + type.name() + " was not added to the test");
133-
}
134-
assertEquals(expectedMsg, ex.getCause().getMessage());
125+
String expectedMsg;
126+
switch (type) {
127+
case GEOHASH:
128+
expectedMsg = "Invalid geohash aggregation precision of 13. Must be between 1 and 12.";
129+
break;
130+
default:
131+
throw new IllegalArgumentException("GeoHashType." + type.name() + " was not added to the test");
135132
}
133+
assertEquals(expectedMsg, ex.getCause().getMessage());
136134
}
137135
}
138136
}

0 commit comments

Comments
 (0)