From 780f955da08ce208001532b4ffdf211eb74b7735 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 25 Dec 2021 14:29:24 +0100 Subject: [PATCH] Fix Blockhound setup foe Elasticsearch 7.16, dependency version updates. --- pom.xml | 9 +++++---- .../blockhound/BlockHoundIntegrationCustomizer.java | 6 +++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index a3ae6f679..eed998eee 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ 2.17.0 4.1.65.Final 2.7.0-SNAPSHOT - 1.15.3 + 1.16.2 1.0.6.RELEASE spring.data.elasticsearch @@ -163,7 +163,7 @@ org.apache.geronimo.specs geronimo-jcdi_2.0_spec - 1.0.1 + 1.3 test @@ -229,6 +229,7 @@ org.projectlombok lombok + 999999 test @@ -243,7 +244,7 @@ com.github.tomakehurst wiremock-jre8 - 2.26.3 + 2.32.0 test @@ -261,7 +262,7 @@ io.specto hoverfly-java-junit5 - 0.13.1 + 0.14.1 test diff --git a/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java b/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java index 3de42aaea..ef2e1daff 100644 --- a/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java +++ b/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java @@ -27,10 +27,14 @@ public class BlockHoundIntegrationCustomizer implements BlockHoundIntegration { @Override public void applyTo(BlockHound.Builder builder) { // Elasticsearch classes reading from the classpath on initialization, needed for parsing Elasticsearch responses - builder.allowBlockingCallsInside("org.elasticsearch.common.xcontent.XContentBuilder", "") + builder // + .allowBlockingCallsInside("org.elasticsearch.common.xcontent.XContentBuilder", "") // pre 7.16 + .allowBlockingCallsInside("org.elasticsearch.common.XContentBuilder", "") // from 7.16 on + .allowBlockingCallsInside("org.elasticsearch.xcontent.json.JsonXContent", "contentBuilder") // from 7.16 on .allowBlockingCallsInside("org.elasticsearch.Build", ""); builder.blockingMethodCallback(it -> { + new Error(it.toString()).printStackTrace(); throw new BlockingOperationError(it); });