Skip to content

Commit 780f955

Browse files
committed
Fix Blockhound setup foe Elasticsearch 7.16, dependency version updates.
1 parent 4835df7 commit 780f955

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

pom.xml

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<log4j>2.17.0</log4j>
2424
<netty>4.1.65.Final</netty>
2525
<springdata.commons>2.7.0-SNAPSHOT</springdata.commons>
26-
<testcontainers>1.15.3</testcontainers>
26+
<testcontainers>1.16.2</testcontainers>
2727
<blockhound-junit>1.0.6.RELEASE</blockhound-junit>
2828
<java-module-name>spring.data.elasticsearch</java-module-name>
2929

@@ -163,7 +163,7 @@
163163
<dependency>
164164
<groupId>org.apache.geronimo.specs</groupId>
165165
<artifactId>geronimo-jcdi_2.0_spec</artifactId>
166-
<version>1.0.1</version>
166+
<version>1.3</version>
167167
<scope>test</scope>
168168
</dependency>
169169

@@ -229,6 +229,7 @@
229229
<dependency>
230230
<groupId>org.projectlombok</groupId>
231231
<artifactId>lombok</artifactId>
232+
<!--suppress MavenPackageUpdate -->
232233
<version>999999</version>
233234
<scope>test</scope>
234235
</dependency>
@@ -243,7 +244,7 @@
243244
<dependency>
244245
<groupId>com.github.tomakehurst</groupId>
245246
<artifactId>wiremock-jre8</artifactId>
246-
<version>2.26.3</version>
247+
<version>2.32.0</version>
247248
<scope>test</scope>
248249
<exclusions>
249250
<!-- these exclusions are needed because of Elasticsearch JarHell-->
@@ -261,7 +262,7 @@
261262
<dependency>
262263
<groupId>io.specto</groupId>
263264
<artifactId>hoverfly-java-junit5</artifactId>
264-
<version>0.13.1</version>
265+
<version>0.14.1</version>
265266
<scope>test</scope>
266267
</dependency>
267268

src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ public class BlockHoundIntegrationCustomizer implements BlockHoundIntegration {
2727
@Override
2828
public void applyTo(BlockHound.Builder builder) {
2929
// Elasticsearch classes reading from the classpath on initialization, needed for parsing Elasticsearch responses
30-
builder.allowBlockingCallsInside("org.elasticsearch.common.xcontent.XContentBuilder", "<clinit>")
30+
builder //
31+
.allowBlockingCallsInside("org.elasticsearch.common.xcontent.XContentBuilder", "<clinit>") // pre 7.16
32+
.allowBlockingCallsInside("org.elasticsearch.common.XContentBuilder", "<clinit>") // from 7.16 on
33+
.allowBlockingCallsInside("org.elasticsearch.xcontent.json.JsonXContent", "contentBuilder") // from 7.16 on
3134
.allowBlockingCallsInside("org.elasticsearch.Build", "<clinit>");
3235

3336
builder.blockingMethodCallback(it -> {
37+
new Error(it.toString()).printStackTrace();
3438
throw new BlockingOperationError(it);
3539
});
3640

0 commit comments

Comments
 (0)