Skip to content

Commit

Permalink
Remove BlockHound dependency
Browse files Browse the repository at this point in the history
The dependency is not needed anymore and there is a issue when using OpenJDK 13 or higher reactor/BlockHound#33

Issue spring-projectsgh-10343
  • Loading branch information
marcusdacoregio committed Oct 19, 2021
1 parent 8d867b0 commit a3b60ae
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion dependencies/spring-security-dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dependencies {
api "commons-collections:commons-collections:3.2.2"
api "commons-logging:commons-logging:1.2"
api "io.mockk:mockk:1.12.0"
api "io.projectreactor.tools:blockhound:1.0.6.RELEASE"
api "javax.annotation:jsr250-api:1.0"
api "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.2"
api "javax.servlet.jsp:javax.servlet.jsp-api:2.3.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import reactor.blockhound.BlockHound;
import reactor.util.context.Context;

import org.springframework.http.HttpHeaders;
Expand Down Expand Up @@ -89,23 +87,6 @@ public class ServletOAuth2AuthorizedClientExchangeFilterFunctionITests {

private MockHttpServletResponse response;

@BeforeAll
public static void setUpBlockingChecks() {
// IMPORTANT:
// Before enabling BlockHound, we need to white-list
// `java.lang.Class.getPackage()`.
// When the JVM loads `java.lang.Package.getSystemPackage()`, it attempts to
// `java.lang.Package.loadManifest()` which is blocking I/O and triggers
// BlockHound to error.
// NOTE: This is an issue with JDK 8. It's been tested on JDK 10 and works fine
// w/o this white-list.
// @formatter:off
BlockHound.builder()
.allowBlockingCallsInside(Class.class.getName(), "getPackage")
.install();
// @formatter:on
}

@BeforeEach
public void setUp() throws Exception {
this.clientRegistrationRepository = mock(ClientRegistrationRepository.class);
Expand Down

0 comments on commit a3b60ae

Please sign in to comment.