[TEST] Fix failure due to exception message in java11
Java 11 uses more verbose exceptions messages, causing this assertion
to fail.  Changed the test to be less restrictive and only look
for the classes we care about.
@@ -509,10 +509,12 @@ public class RollupResponseTranslationTests extends AggregatorTestCase {
BigArrays bigArrays = new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), new NoneCircuitBreakerService());
ScriptService scriptService = mock(ScriptService.class);
InternalAggregation.ReduceContext reduceContext = new InternalAggregation.ReduceContext(bigArrays, scriptService, true);
- Exception e = expectThrows(RuntimeException.class,
+ ClassCastException e = expectThrows(ClassCastException.class,
() -> RollupResponseTranslator.combineResponses(msearch, reduceContext));
- assertThat(e.getMessage(), equalTo("org.elasticsearch.search.aggregations.metrics.geobounds.InternalGeoBounds " +
- "cannot be cast to org.elasticsearch.search.aggregations.InternalMultiBucketAggregation"));
+ assertThat(e.getMessage(),
+ containsString("org.elasticsearch.search.aggregations.metrics.geobounds.InternalGeoBounds"));
+ assertThat(e.getMessage(),
+ containsString("org.elasticsearch.search.aggregations.InternalMultiBucketAggregation"));
}
public void testDateHisto() throws IOException {
