Updates for sleuth 2 changes
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
package demo;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import brave.Tracer;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
import org.springframework.cloud.sleuth.Tracer;
|
||||
import org.springframework.cloud.sleuth.trace.DefaultTracer;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||
@DirtiesContext
|
||||
public class TraceApplicationTests {
|
||||
|
||||
@Autowired
|
||||
@Autowired(required = false)
|
||||
Tracer traceManager;
|
||||
|
||||
@Test
|
||||
@@ -26,6 +25,6 @@ public class TraceApplicationTests {
|
||||
|
||||
@Test
|
||||
public void traceIsDefaultTrace() {
|
||||
assertTrue("trace is wrong type", this.traceManager instanceof DefaultTracer);
|
||||
assertNotNull("Tracer was null", this.traceManager);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user