Test latest struts 6.x version (#12948)
This commit is contained in:
parent
aeb1b787ce
commit
f30601d3e4
|
@ -27,7 +27,7 @@ dependencies {
|
|||
testInstrumentation(project(":instrumentation:jetty:jetty-8.0:javaagent"))
|
||||
testInstrumentation(project(":instrumentation:struts:struts-7.0:javaagent"))
|
||||
|
||||
latestDepTestLibrary("org.apache.struts:struts2-core:6.0.+")
|
||||
latestDepTestLibrary("org.apache.struts:struts2-core:6.+")
|
||||
}
|
||||
|
||||
tasks.withType<Test>().configureEach {
|
||||
|
|
|
@ -5,12 +5,14 @@
|
|||
|
||||
package io.opentelemetry.javaagent.instrumentation.struts.v7_0;
|
||||
|
||||
import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;
|
||||
import static java.util.Collections.singletonList;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
|
||||
import java.util.List;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
@AutoService(InstrumentationModule.class)
|
||||
public class Struts2InstrumentationModule extends InstrumentationModule {
|
||||
|
@ -19,6 +21,12 @@ public class Struts2InstrumentationModule extends InstrumentationModule {
|
|||
super("struts", "struts-7.0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
|
||||
// class is in different package before 7.0
|
||||
return hasClassesNamed("org.apache.struts2.config.entities.ActionConfig");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypeInstrumentation> typeInstrumentations() {
|
||||
return singletonList(new ActionInvocationInstrumentation());
|
||||
|
|
Loading…
Reference in New Issue