mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 14:26:27 +00:00
[Tests] Fix failure due to changes exception message (#32036)
Java 11 seems to get more verbose on the ClassCastException we check for in SearchDocumentationIT. This changes the test from asserting the exact exception message to only checking the two classes involved are part of the message. Closes #32029
This commit is contained in:
parent
ca4c4f736a
commit
3587d8872e
@ -295,7 +295,6 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unused" })
|
||||
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/32029")
|
||||
public void testSearchRequestAggregations() throws IOException {
|
||||
RestHighLevelClient client = highLevelClient();
|
||||
{
|
||||
@ -338,8 +337,9 @@ public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {
|
||||
Range range = aggregations.get("by_company"); // <1>
|
||||
// end::search-request-aggregations-get-wrongCast
|
||||
} catch (ClassCastException ex) {
|
||||
assertEquals("org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms"
|
||||
+ " cannot be cast to org.elasticsearch.search.aggregations.bucket.range.Range", ex.getMessage());
|
||||
String message = ex.getMessage();
|
||||
assertThat(message, containsString("org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms"));
|
||||
assertThat(message, containsString("org.elasticsearch.search.aggregations.bucket.range.Range"));
|
||||
}
|
||||
assertEquals(3, elasticBucket.getDocCount());
|
||||
assertEquals(30, avg, 0.0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user