Refine BlockHound support

- disable for Java 14/15 for now until BlockHound support
- targeted installation of required integrations only
This commit is contained in:
Rossen Stoyanchev 2020-02-25 10:07:15 +00:00
parent b6f502db4e
commit 2f12351292
1 changed files with 8 additions and 1 deletions

View File

@ -21,7 +21,9 @@ import java.util.concurrent.CompletableFuture;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import reactor.blockhound.BlockHound;
import reactor.core.scheduler.ReactorBlockHoundIntegration;
import reactor.core.scheduler.Schedulers;
import org.springframework.tests.sample.objects.TestObject;
@ -29,6 +31,7 @@ import org.springframework.util.ConcurrentReferenceHashMap;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.condition.JRE.JAVA_14;
/**
* Tests to verify the spring-core BlockHound integration rules.
@ -36,12 +39,16 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
* @author Rossen Stoyanchev
* @since 5.2.4
*/
@DisabledForJreRange(min = JAVA_14)
public class SpringCoreBlockHoundIntegrationTests {
@BeforeAll
static void setUp() {
BlockHound.install();
BlockHound.builder()
.with(new ReactorBlockHoundIntegration()) // Reactor non-blocking thread predicate
.with(new ReactiveAdapterRegistry.SpringCoreBlockHoundIntegration())
.install();
}