From a43b667aeba9271e8f77eb113679d46d8c29c060 Mon Sep 17 00:00:00 2001 From: Sylvain Juge <763082+SylvainJuge@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:13:26 +0100 Subject: [PATCH] also test interface is hidden from reflection --- .../src/test/java/ReflectionTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/ReflectionTest.java b/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/ReflectionTest.java index f75f892d7879..4b5e4ff45f06 100644 --- a/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/ReflectionTest.java +++ b/instrumentation/internal/internal-reflection/javaagent-integration-tests/src/test/java/ReflectionTest.java @@ -66,6 +66,12 @@ void testInjectedClassProxyUnwrap() throws Exception { .isNotEqualTo("__getIndyProxyDelegate"); } + for (Class interfaceType : helperType.getInterfaces()) { + assertThat(interfaceType) + .describedAs("indy proxy interface must be hidden from reflection") + .isNotEqualTo(IndyProxy.class); + } + assertThat(instance).isInstanceOf(IndyProxy.class); Object proxyDelegate = ((IndyProxy) instance).__getIndyProxyDelegate();