use of com.newrelic.agent.instrumentation.methodmatchers.NoMethodsMatcher in project newrelic-java-agent by newrelic.
the class PointCutConfigTest method invalidMethodDescriptor.
@Test
public void invalidMethodDescriptor() throws Exception {
PointCutConfig config = new PointCutConfig(new ByteArrayInputStream("pre:\n class_matcher: !exact_class_matcher 'java/lang/String'\n method_matcher: !exact_method_matcher [ 'concat', '(java/lang/String;)Ljava/lang/String;' ]\n".getBytes(StandardCharsets.UTF_8)));
List<ExtensionClassAndMethodMatcher> pcs = config.getPointCuts();
Assert.assertEquals(1, pcs.size());
ExtensionClassAndMethodMatcher pc = config.getPointCuts().get(0);
Assert.assertNotNull(pc);
MethodMatcher methodMatcher = pc.getMethodMatcher();
Assert.assertTrue(methodMatcher instanceof NoMethodsMatcher);
}
Aggregations