From ae7cb0c36da7791d6ca886e82e09a1f490dd0825 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 11:44:01 -0800 Subject: [PATCH] Allow security manager in IntelliJ unit tests (#12330) (#12335) 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. (cherry picked from commit f73c82aa466cf3354b5d2e3e3f46f0613cacbb0f) Signed-off-by: Andrew Ross Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- 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 {