Updates for sleuth 2 changes

This commit is contained in:
Spencer Gibb
2018-01-22 15:29:17 -05:00
parent fbc8eca31d
commit 5a6d76d003
2 changed files with 7 additions and 18 deletions

View File

@@ -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);
}
}