Fix TracingSegmentRunner (testing only) (#688)
This commit is contained in:
parent
7dd7914765
commit
0bf535e861
|
|
@ -55,7 +55,7 @@ public class TracingSegmentRunner extends BlockJUnit4ClassRunner {
|
|||
|
||||
@Override
|
||||
protected Statement withAfters(FrameworkMethod method, Object target, final Statement statement) {
|
||||
return new Statement() {
|
||||
Statement st = new Statement() {
|
||||
@Override
|
||||
public void evaluate() throws Throwable {
|
||||
if (field != null) {
|
||||
|
|
@ -89,5 +89,7 @@ public class TracingSegmentRunner extends BlockJUnit4ClassRunner {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
return super.withAfters(method, target, st);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class TracingSegmentRunner extends BlockJUnit4ClassRunner {
|
|||
|
||||
@Override
|
||||
protected Statement withAfters(FrameworkMethod method, Object target, final Statement statement) {
|
||||
return new Statement() {
|
||||
Statement st = new Statement() {
|
||||
@Override
|
||||
public void evaluate() throws Throwable {
|
||||
if (field != null) {
|
||||
|
|
@ -89,5 +89,7 @@ public class TracingSegmentRunner extends BlockJUnit4ClassRunner {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
return super.withAfters(method, target, st);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,8 +92,6 @@ public class MicrometerContextSnapshotThreadLocalAccessorInterceptorTest {
|
|||
@AfterClass
|
||||
public static void clearAfterAll() {
|
||||
// test from threadlocalaccessor test x 2 TODO: I have no idea what is going on
|
||||
ContextManager.stopSpan();
|
||||
ContextManager.stopSpan();
|
||||
assertThat(ContextManager.isActive(), is(false));
|
||||
}
|
||||
|
||||
|
|
@ -103,6 +101,7 @@ public class MicrometerContextSnapshotThreadLocalAccessorInterceptorTest {
|
|||
PluginBootService.class);
|
||||
|
||||
Assert.assertNotNull(service);
|
||||
ContextManager.stopSpan();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -110,6 +109,7 @@ public class MicrometerContextSnapshotThreadLocalAccessorInterceptorTest {
|
|||
ContextManagerExtendService service = ServiceManager.INSTANCE.findService(ContextManagerExtendService.class);
|
||||
|
||||
Assert.assertTrue(service instanceof ContextManagerExtendOverrideService);
|
||||
ContextManager.stopSpan();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue