Skip to content

Commit

Permalink
Update TraceAnnotationTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
sdaubin committed Apr 4, 2024
1 parent 504507c commit da2f302
Showing 1 changed file with 10 additions and 5 deletions.
Expand Up @@ -7,6 +7,7 @@

package test.newrelic.test.agent;

import com.newrelic.agent.Agent;
import com.newrelic.agent.AgentHelper;
import com.newrelic.agent.MetricNames;
import com.newrelic.agent.Transaction;
Expand Down Expand Up @@ -269,17 +270,16 @@ public void testDoubleArrayArgs() throws Exception {
}

@Test
@Trace(dispatcher = true)
public void testOTelWithSpan() {
withSpan();

Set<String> metrics = AgentHelper.getMetrics();
AgentHelper.verifyMetrics(metrics, MessageFormat.format("Custom/{0}/withSpan", Simple.class.getName()));
}

@WithSpan
private void withSpan() {

@Trace(dispatcher = true)
static void withSpan() {
new Simple().withSpan();
}

@Trace(dispatcher = true)
Expand Down Expand Up @@ -320,7 +320,12 @@ private void callCharArray() {
new Simple().charArray(new char[] { 6 });
}

private class Simple {
private static class Simple {
@WithSpan
void withSpan() {
Agent.LOG.info("withSpan");
}

@Trace
private void foo() throws InterruptedException {
Thread.sleep(200);
Expand Down

0 comments on commit da2f302

Please sign in to comment.