|
@@ -250,10 +250,9 @@ public class QueryStringIT extends ESIntegTestCase {
|
|
|
}
|
|
|
|
|
|
public void testBooleanStrictQuery() throws Exception {
|
|
|
- Exception e = expectThrows(Exception.class, () ->
|
|
|
- client().prepareSearch("test").setQuery(
|
|
|
- queryStringQuery("foo").field("f_bool")).get());
|
|
|
- assertThat(ExceptionsHelper.detailedMessage(e),
|
|
|
+ Exception e = expectThrows(Exception.class,
|
|
|
+ () -> client().prepareSearch("test").setQuery(queryStringQuery("foo").field("f_bool")).get());
|
|
|
+ assertThat(ExceptionsHelper.unwrap(e, IllegalArgumentException.class).getMessage(),
|
|
|
containsString("Can't parse boolean value [foo], expected [true] or [false]"));
|
|
|
}
|
|
|
|
|
@@ -261,8 +260,7 @@ public class QueryStringIT extends ESIntegTestCase {
|
|
|
Exception e = expectThrows(Exception.class, () ->
|
|
|
client().prepareSearch("test").setQuery(
|
|
|
queryStringQuery("f_date:[now-2D TO now]").lenient(false)).get());
|
|
|
- assertThat(ExceptionsHelper.detailedMessage(e),
|
|
|
- containsString("unit [D] not supported for date math [-2D]"));
|
|
|
+ assertThat(e.getCause().getMessage(), containsString("unit [D] not supported for date math [-2D]"));
|
|
|
}
|
|
|
|
|
|
public void testLimitOnExpandedFields() throws Exception {
|
|
@@ -288,11 +286,11 @@ public class QueryStringIT extends ESIntegTestCase {
|
|
|
Exception e = expectThrows(Exception.class, () -> {
|
|
|
QueryStringQueryBuilder qb = queryStringQuery("bar");
|
|
|
if (randomBoolean()) {
|
|
|
- qb.useAllFields(true);
|
|
|
+ qb.defaultField("*");
|
|
|
}
|
|
|
client().prepareSearch("toomanyfields").setQuery(qb).get();
|
|
|
});
|
|
|
- assertThat(ExceptionsHelper.detailedMessage(e),
|
|
|
+ assertThat(ExceptionsHelper.unwrap(e, IllegalArgumentException.class).getMessage(),
|
|
|
containsString("field expansion matches too many fields, limit: " + CLUSTER_MAX_CLAUSE_COUNT + ", got: "
|
|
|
+ (CLUSTER_MAX_CLAUSE_COUNT + 1)));
|
|
|
}
|