package demo; import static org.junit.Assert.assertTrue; 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; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) @DirtiesContext public class TraceApplicationTests { @Autowired Tracer traceManager; @Test public void contextLoads() { } @Test public void traceIsDefaultTrace() { assertTrue("trace is wrong type", this.traceManager instanceof DefaultTracer); } }