diff --git a/pom.xml b/pom.xml index 8a7694c1ab..210333c13c 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,6 @@ 8.15.0 - 1.0.9.RELEASE 0.19.0 2.23.1 1.5.3 @@ -237,13 +236,6 @@ test - - io.projectreactor.tools - blockhound-junit-platform - ${blockhound-junit} - test - - org.skyscreamer jsonassert @@ -432,25 +424,6 @@ - - jdk13+ - - - [13,) - - - - - org.apache.maven.plugins - maven-surefire-plugin - - -XX:+AllowRedefinitionToAddDeleteMethods - - - - - - antora-process-resources diff --git a/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java b/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java deleted file mode 100644 index 1f79dc622e..0000000000 --- a/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2021-2024 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.blockhound; - -import reactor.blockhound.BlockHound; -import reactor.blockhound.BlockingOperationError; -import reactor.blockhound.integration.BlockHoundIntegration; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * @author Peter-Josef Meisch - */ -public class BlockHoundIntegrationCustomizer implements BlockHoundIntegration { - - private static final Log LOGGER = LogFactory.getLog(BlockHoundIntegrationCustomizer.class); - - @Override - public void applyTo(BlockHound.Builder builder) { - // Elasticsearch classes reading from the classpath on initialization, needed for parsing Elasticsearch responses - builder // - .allowBlockingCallsInside("org.elasticsearch.Build", "") // - .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("jakarta.json.spi.JsonProvider", "provider") // - ; - builder.blockingMethodCallback(it -> { - LOGGER.error("BlockHound error", new Error(it.toString())); - throw new BlockingOperationError(it); - }); - - } -} diff --git a/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundTests.java b/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundTests.java deleted file mode 100644 index 2e10327d45..0000000000 --- a/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundTests.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2021-2024 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.blockhound; - -import static org.assertj.core.api.Assertions.*; - -import reactor.blockhound.BlockingOperationError; -import reactor.core.publisher.Mono; - -import java.time.Duration; - -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -/** - * @author Peter-Josef Meisch - */ -public class BlockHoundTests { - - @Test // #1822 - @DisplayName("should fail if BlockHound is not installed") - void shouldFailIfBlockHoundIsNotInstalled() { - - assertThatThrownBy(() -> { - Mono.delay(Duration.ofMillis(1)).doOnNext(it -> { - try { - Thread.sleep(10); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - }).block(); // should throw an exception about Thread.sleep - }).hasCauseInstanceOf(BlockingOperationError.class); - } -} diff --git a/src/test/resources/META-INF/services/reactor.blockhound.integration.BlockHoundIntegration b/src/test/resources/META-INF/services/reactor.blockhound.integration.BlockHoundIntegration deleted file mode 100644 index 1cd5f8f92f..0000000000 --- a/src/test/resources/META-INF/services/reactor.blockhound.integration.BlockHoundIntegration +++ /dev/null @@ -1 +0,0 @@ -org.springframework.data.elasticsearch.blockhound.BlockHoundIntegrationCustomizer