Skip to content

Commit a8cb0f8

Browse files
moscherjernst
andauthored
Skip plugins service create classloader test for jdk 24+ (#122067) (#123469)
This test is only relevant when security manager is available. This commit skips the test otherwise. closes #121870 (cherry picked from commit 840ee0f) Co-authored-by: Ryan Ernst <[email protected]>
1 parent d684a2c commit a8cb0f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.elasticsearch.env.Environment;
1919
import org.elasticsearch.env.TestEnvironment;
2020
import org.elasticsearch.index.IndexModule;
21+
import org.elasticsearch.jdk.RuntimeVersionFeature;
2122
import org.elasticsearch.plugin.analysis.CharFilterFactory;
2223
import org.elasticsearch.plugins.scanners.PluginInfo;
2324
import org.elasticsearch.plugins.spi.BarPlugin;
@@ -873,6 +874,7 @@ public Reader create(Reader reader) {
873874
}
874875

875876
public void testCanCreateAClassLoader() {
877+
assumeTrue("security manager must be available", RuntimeVersionFeature.isSecurityManagerAvailable());
876878
assertEquals(
877879
"access denied (\"java.lang.RuntimePermission\" \"createClassLoader\")",
878880
expectThrows(AccessControlException.class, () -> new Loader(this.getClass().getClassLoader())).getMessage()

0 commit comments

Comments
 (0)