use of com.newrelic.agent.TransactionApiImpl in project newrelic-java-agent by newrelic.
the class CircuitBreakerServiceFunctionalTest method aTransaction.
@Trace(dispatcher = true)
private void aTransaction(boolean breakerTripped) {
Transaction transaction = NewRelic.getAgent().getTransaction();
InstrumentationImpl impl = new InstrumentationImpl(Agent.LOG);
if (breakerTripped) {
ExitTracer createdTracer = impl.createTracer(null, 0, "metricName", TracerFlags.DISPATCHER);
Assert.assertNull(createdTracer);
Assert.assertTrue(transaction instanceof NoOpTransaction);
} else {
Assert.assertTrue(transaction instanceof TransactionApiImpl);
}
}
Aggregations