Skip to content

Commit

Permalink
Migrate tracing module to junit5 (#4112)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengxiangrui127 authored Dec 9, 2023
1 parent ede3d2b commit 6066887
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,19 @@
import org.apache.servicecomb.tracing.zipkin.app.ZipkinSpanTestApplication.CustomSpanTask;
import org.apache.servicecomb.tracing.zipkin.app.ZipkinSpanTestApplication.SomeSlowTask;
import org.hamcrest.MatcherAssert;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.junit4.SpringRunner;

import brave.Tracing;
import brave.propagation.StrictScopeDecorator;
import brave.propagation.ThreadLocalCurrentTraceContext;
import zipkin2.Span;
import zipkin2.reporter.brave.ZipkinSpanHandler;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = {ZipkinSpanTestApplication.class, TracingConfig.class})
public class ZipkinSpanAspectTest {
private Queue<Span> spans;
Expand Down Expand Up @@ -83,7 +80,7 @@ public void setTracing(Tracing tracing) {
public ZipkinSpanAspectTest() {
}

@After
@AfterEach
public void tearDown() throws Exception {
tracing.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@

import org.apache.servicecomb.tracing.zipkin.ZipkinTracingAdviser.ThrowableSupplier;
import org.hamcrest.MatcherAssert;
import org.junit.After;
import org.junit.Test;

import brave.Span;
import brave.Tracer.SpanInScope;
import brave.Tracing;
import brave.propagation.StrictScopeDecorator;
import brave.propagation.ThreadLocalCurrentTraceContext;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import zipkin2.reporter.brave.ZipkinSpanHandler;

Expand Down Expand Up @@ -76,7 +76,7 @@ public class ZipkinTracingAdviserTest {

private final ZipkinTracingAdviser tracingAdviser = new ZipkinTracingAdviser(tracing.tracer());

@After
@AfterEach
public void tearDown() throws Exception {
tracing.close();
}
Expand Down

0 comments on commit 6066887

Please sign in to comment.