for completeness, add unit test for groupby/having with unrecognized type

This commit is contained in:
Robin 2015-12-21 11:30:26 -06:00
parent 78215a2053
commit dded4441d3
1 changed files with 13 additions and 0 deletions

View File

@ -87,6 +87,19 @@ public class HavingSpecTest
assertEquals(andHavingSpec, mapper.convertValue(payloadMap, AndHavingSpec.class));
}
@Test(expected = IllegalArgumentException.class)
public void testTypeTypo()
{
Map<String, Object> greaterMap = ImmutableMap.<String, Object>of(
"type", "nonExistingType",
"aggregation", "agg",
"value", 1.3
);
ObjectMapper mapper = new DefaultObjectMapper();
HavingSpec spec = mapper.convertValue (greaterMap, HavingSpec.class);
}
@Test
public void testGreaterThanHavingSpec() {
GreaterThanHavingSpec spec = new GreaterThanHavingSpec("metric", Long.valueOf(Long.MAX_VALUE - 10));