diff --git a/libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/DummyImplementations.java b/libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/DummyImplementations.java
index 2169b60df21c5..6564e0eed41e1 100644
--- a/libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/DummyImplementations.java
+++ b/libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/DummyImplementations.java
@@ -52,9 +52,10 @@
*
* A bit like Mockito but way more painful.
*/
-public class DummyImplementations {
+class DummyImplementations {
+
+ static class DummyLocaleServiceProvider extends LocaleServiceProvider {
- public static class DummyLocaleServiceProvider extends LocaleServiceProvider {
@Override
public Locale[] getAvailableLocales() {
throw unexpected();
diff --git a/libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/RestEntitlementsCheckAction.java b/libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/RestEntitlementsCheckAction.java
index 2581593b730f3..dfca49d122673 100644
--- a/libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/RestEntitlementsCheckAction.java
+++ b/libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/RestEntitlementsCheckAction.java
@@ -96,9 +96,6 @@ static CheckAction alwaysDenied(CheckedRunnable action) {
private static final Map checkActions = Stream.concat(
Stream.>of(
- entry("static_reflection", deniedToPlugins(RestEntitlementsCheckAction::staticMethodNeverEntitledViaReflection)),
- entry("nonstatic_reflection", deniedToPlugins(RestEntitlementsCheckAction::nonstaticMethodNeverEntitledViaReflection)),
- entry("constructor_reflection", deniedToPlugins(RestEntitlementsCheckAction::constructorNeverEntitledViaReflection)),
entry("runtime_exit", deniedToPlugins(RestEntitlementsCheckAction::runtimeExit)),
entry("runtime_halt", deniedToPlugins(RestEntitlementsCheckAction::runtimeHalt)),
entry("system_exit", deniedToPlugins(RestEntitlementsCheckAction::systemExit)),
@@ -341,11 +338,6 @@ private static void systemExit() {
System.exit(123);
}
- private static void staticMethodNeverEntitledViaReflection() throws Exception {
- Method systemExit = System.class.getMethod("exit", int.class);
- systemExit.invoke(null, 123);
- }
-
private static void createClassLoader() throws IOException {
try (var classLoader = new URLClassLoader("test", new URL[0], RestEntitlementsCheckAction.class.getClassLoader())) {
logger.info("Created URLClassLoader [{}]", classLoader.getName());
@@ -356,11 +348,6 @@ private static void processBuilder_start() throws IOException {
new ProcessBuilder("").start();
}
- private static void nonstaticMethodNeverEntitledViaReflection() throws Exception {
- Method processBuilderStart = ProcessBuilder.class.getMethod("start");
- processBuilderStart.invoke(new ProcessBuilder(""));
- }
-
private static void processBuilder_startPipeline() throws IOException {
ProcessBuilder.startPipeline(List.of());
}
@@ -399,10 +386,6 @@ private static void setHttpsConnectionProperties() {
new DummyLocaleServiceProvider();
}
- private static void constructorNeverEntitledViaReflection() throws Exception {
- DummyLocaleServiceProvider.class.getConstructor().newInstance();
- }
-
private static void breakIteratorProvider$() {
new DummyBreakIteratorProvider();
}