From f73c82aa466cf3354b5d2e3e3f46f0613cacbb0f Mon Sep 17 00:00:00 2001 From: Andrew Ross Date: Thu, 15 Feb 2024 07:39:10 -0800 Subject: [PATCH] Allow security manager in IntelliJ unit tests (#12330) If you configure IntelliJ to use JDK 21 then all unit tests will fail to run in the IDE when attempting to set the security manager in the test bootstrap code. This change configures all tests to include the required VM argument to enable the security manager. Signed-off-by: Andrew Ross --- gradle/ide.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gradle/ide.gradle b/gradle/ide.gradle index bc442a081adf0..14d6b2982ccd0 100644 --- a/gradle/ide.gradle +++ b/gradle/ide.gradle @@ -82,6 +82,9 @@ if (System.getProperty('idea.active') == 'true') { runConfigurations { defaults(JUnit) { vmParameters = '-ea -Djava.locale.providers=SPI,COMPAT' + if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_17) { + vmParameters += ' -Djava.security.manager=allow' + } } } copyright {