Fix muzzle test for 3.0
This commit is contained in:
parent
73eb217721
commit
c72f2d3b45
|
@ -1,5 +1,6 @@
|
|||
package datadog.trace.instrumentation.jedis;
|
||||
|
||||
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
|
||||
import static datadog.trace.instrumentation.api.AgentTracer.activateSpan;
|
||||
import static datadog.trace.instrumentation.api.AgentTracer.startSpan;
|
||||
import static datadog.trace.instrumentation.jedis.JedisClientDecorator.DECORATE;
|
||||
|
@ -7,6 +8,7 @@ import static java.util.Collections.singletonMap;
|
|||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.not;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
|
@ -30,9 +32,14 @@ public final class JedisInstrumentation extends Instrumenter.Default {
|
|||
super("jedis", "redis");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElementMatcher<ClassLoader> classLoaderMatcher() {
|
||||
return not(classLoaderHasClasses("redis.clients.jedis.commands.ProtocolCommand"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return named("redis.clients.jedis.Protocol").and(named("redis.clients.jedis.JedisCommands"));
|
||||
return named("redis.clients.jedis.Protocol");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
muzzle {
|
||||
fail {
|
||||
group = "redis.clients"
|
||||
module = "jedis"
|
||||
versions = "[,3.0.0)"
|
||||
}
|
||||
|
||||
pass {
|
||||
group = "redis.clients"
|
||||
module = "jedis"
|
||||
versions = "[3.0.0,)"
|
||||
assertInverse = true
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,6 +27,6 @@ dependencies {
|
|||
|
||||
testCompile group: 'com.github.kstyrc', name: 'embedded-redis', version: '0.6'
|
||||
testCompile group: 'redis.clients', name: 'jedis', version: '3.0.0'
|
||||
|
||||
|
||||
latestDepTestCompile group: 'redis.clients', name: 'jedis', version: '3.+'
|
||||
}
|
||||
|
|
|
@ -30,8 +30,7 @@ public final class JedisInstrumentation extends Instrumenter.Default {
|
|||
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return named("redis.clients.jedis.Protocol")
|
||||
.and(named("redis.clients.jedis.commands.ProtocolCommand"));
|
||||
return named("redis.clients.jedis.Protocol");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue