From a3b0e31b4b0ba855e471452c4c6a8bdbaec815e4 Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Fri, 17 Nov 2023 17:49:04 +0200 Subject: [PATCH] Enable running with indy for jodd-http-4.2 (#9898) --- .../javaagent-unit-tests/build.gradle.kts | 10 ++++++++++ .../v4_2/JoddHttpHttpAttributesGetterTest.java | 0 .../joddhttp/v4_2/JoddHttpInstrumentationModule.java | 7 ------- settings.gradle.kts | 1 + 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 instrumentation/jodd-http-4.2/javaagent-unit-tests/build.gradle.kts rename instrumentation/jodd-http-4.2/{javaagent => javaagent-unit-tests}/src/test/java/io/opentelemetry/javaagent/instrumentation/joddhttp/v4_2/JoddHttpHttpAttributesGetterTest.java (100%) diff --git a/instrumentation/jodd-http-4.2/javaagent-unit-tests/build.gradle.kts b/instrumentation/jodd-http-4.2/javaagent-unit-tests/build.gradle.kts new file mode 100644 index 000000000000..b7ce4fb1c6cb --- /dev/null +++ b/instrumentation/jodd-http-4.2/javaagent-unit-tests/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + id("otel.java-conventions") +} + +dependencies { + testImplementation("org.jodd:jodd-http:4.2.0") + testImplementation(project(":instrumentation:jodd-http-4.2:javaagent")) + testImplementation(project(":instrumentation-api")) + testImplementation(project(":instrumentation-api-semconv")) +} diff --git a/instrumentation/jodd-http-4.2/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/joddhttp/v4_2/JoddHttpHttpAttributesGetterTest.java b/instrumentation/jodd-http-4.2/javaagent-unit-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/joddhttp/v4_2/JoddHttpHttpAttributesGetterTest.java similarity index 100% rename from instrumentation/jodd-http-4.2/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/joddhttp/v4_2/JoddHttpHttpAttributesGetterTest.java rename to instrumentation/jodd-http-4.2/javaagent-unit-tests/src/test/java/io/opentelemetry/javaagent/instrumentation/joddhttp/v4_2/JoddHttpHttpAttributesGetterTest.java diff --git a/instrumentation/jodd-http-4.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/joddhttp/v4_2/JoddHttpInstrumentationModule.java b/instrumentation/jodd-http-4.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/joddhttp/v4_2/JoddHttpInstrumentationModule.java index c3dd16fb46ed..11f674fb4df2 100644 --- a/instrumentation/jodd-http-4.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/joddhttp/v4_2/JoddHttpInstrumentationModule.java +++ b/instrumentation/jodd-http-4.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/joddhttp/v4_2/JoddHttpInstrumentationModule.java @@ -18,13 +18,6 @@ public JoddHttpInstrumentationModule() { super("jodd-http", "jodd-http-4.2"); } - @Override - public boolean isIndyModule() { - // JoddHttpHttpAttributesGetterTest is not an agent test, with indy it can't access - // JoddHttpHttpAttributesGetter - return false; - } - @Override public List typeInstrumentations() { return Collections.singletonList(new JoddHttpInstrumentation()); diff --git a/settings.gradle.kts b/settings.gradle.kts index 7b69d6c2222e..ac4b9bb3d2fc 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -324,6 +324,7 @@ include(":instrumentation:jms:jms-common:javaagent-unit-tests") include(":instrumentation:jmx-metrics:javaagent") include(":instrumentation:jmx-metrics:library") include(":instrumentation:jodd-http-4.2:javaagent") +include(":instrumentation:jodd-http-4.2:javaagent-unit-tests") include(":instrumentation:jsf:jsf-javax-common:javaagent") include(":instrumentation:jsf:jsf-javax-common:testing") include(":instrumentation:jsf:jsf-jakarta-common:javaagent")