From 931981c3f88f07fba4df8ea15cae622613c5c19a Mon Sep 17 00:00:00 2001 From: Andrew Ross Date: Wed, 14 Feb 2024 16:33:00 -0800 Subject: [PATCH] Allow security manager in IntelliJ unit tests 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 {