diff --git a/core/src/test/java/org/elasticsearch/index/query/AbstractQueryTestCase.java b/core/src/test/java/org/elasticsearch/index/query/AbstractQueryTestCase.java index 93ac3b125c6..5837d5b16ff 100644 --- a/core/src/test/java/org/elasticsearch/index/query/AbstractQueryTestCase.java +++ b/core/src/test/java/org/elasticsearch/index/query/AbstractQueryTestCase.java @@ -435,7 +435,9 @@ public abstract class AbstractQueryTestCase> * Allows to override boost assertions for queries that don't have the default behaviour */ protected void assertBoost(QB queryBuilder, Query query) throws IOException { - assertThat(query.getBoost(), equalTo(queryBuilder.boost())); + // workaround https://bugs.openjdk.java.net/browse/JDK-8056984 + float boost = queryBuilder.boost(); + assertThat(query.getBoost(), equalTo(boost)); } /**