use of com.newrelic.agent.bridge.NoOpSegment in project newrelic-java-agent by newrelic.
the class FlyweightTracerTest method tracedActivityFromFlyweight.
@Trace(excludeFromTransactionTrace = true, leaf = true)
private void tracedActivityFromFlyweight() {
// When you are in a flyweight method you should not be allowed to start a traced activity due to the
// fact that we have no real parent tracer to tie the tracer to. We can revisit this in the future if need be
// but it would require a significant number of changes to the agent
TracedActivity tracedActivity = AgentBridge.getAgent().getTransaction().createAndStartTracedActivity();
Assert.assertTrue(tracedActivity instanceof NoOpSegment);
}
Aggregations