[TEST] Fix failure due to exception message in java11 (#32321)
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.
This commit is contained in:
parent
5a12c63b4e
commit
6cf7588c3d
|
@ -508,10 +508,12 @@ public class RollupResponseTranslationTests extends AggregatorTestCase {
|
||||||
BigArrays bigArrays = new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), new NoneCircuitBreakerService());
|
BigArrays bigArrays = new MockBigArrays(new MockPageCacheRecycler(Settings.EMPTY), new NoneCircuitBreakerService());
|
||||||
ScriptService scriptService = mock(ScriptService.class);
|
ScriptService scriptService = mock(ScriptService.class);
|
||||||
InternalAggregation.ReduceContext reduceContext = new InternalAggregation.ReduceContext(bigArrays, scriptService, true);
|
InternalAggregation.ReduceContext reduceContext = new InternalAggregation.ReduceContext(bigArrays, scriptService, true);
|
||||||
Exception e = expectThrows(RuntimeException.class,
|
ClassCastException e = expectThrows(ClassCastException.class,
|
||||||
() -> RollupResponseTranslator.combineResponses(msearch, reduceContext));
|
() -> RollupResponseTranslator.combineResponses(msearch, reduceContext));
|
||||||
assertThat(e.getMessage(), equalTo("org.elasticsearch.search.aggregations.metrics.geobounds.InternalGeoBounds " +
|
assertThat(e.getMessage(),
|
||||||
"cannot be cast to org.elasticsearch.search.aggregations.InternalMultiBucketAggregation"));
|
containsString("org.elasticsearch.search.aggregations.metrics.geobounds.InternalGeoBounds"));
|
||||||
|
assertThat(e.getMessage(),
|
||||||
|
containsString("org.elasticsearch.search.aggregations.InternalMultiBucketAggregation"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDateHisto() throws IOException {
|
public void testDateHisto() throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue