Applied checkstyle
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
* Copyright 2013-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,6 +19,7 @@ package sample;
|
||||
import java.util.Random;
|
||||
|
||||
import brave.Tracer;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
* Copyright 2013-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,6 +23,7 @@ import brave.Span;
|
||||
import brave.Tracer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.web.servlet.context.ServletWebServerInitializedEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
* Copyright 2013-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,6 +18,7 @@ package sample;
|
||||
|
||||
import zipkin2.Span;
|
||||
import zipkin2.reporter.Reporter;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
@@ -5,7 +5,7 @@ spring:
|
||||
application:
|
||||
# This ends up as the service name in zipkin
|
||||
name: testsleuthzipkin
|
||||
#zipkin:
|
||||
#zipkin:
|
||||
# Uncomment to send to zipkin, replacing 192.168.99.100 with your zipkin IP address
|
||||
# baseUrl: http://192.168.99.100:9411/
|
||||
sleuth:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
* Copyright 2013-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package integration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -28,14 +29,15 @@ import integration.ZipkinTests.WaitUntilZipkinIsUpConfig;
|
||||
import okhttp3.mockwebserver.MockResponse;
|
||||
import okhttp3.mockwebserver.MockWebServer;
|
||||
import okhttp3.mockwebserver.RecordedRequest;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import sample.SampleZipkinApplication;
|
||||
import tools.AbstractIntegrationTest;
|
||||
import tools.SpanUtil;
|
||||
import zipkin2.Span;
|
||||
import zipkin2.codec.SpanBytesDecoder;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
@@ -60,14 +62,14 @@ public class ZipkinTests extends AbstractIntegrationTest {
|
||||
|
||||
private static final String APP_NAME = "testsleuthzipkin";
|
||||
|
||||
@Autowired
|
||||
ZipkinProperties zipkinProperties;
|
||||
|
||||
@Value("${local.server.port}")
|
||||
private int port = 3380;
|
||||
|
||||
private String sampleAppUrl = "http://localhost:" + this.port;
|
||||
|
||||
@Autowired
|
||||
ZipkinProperties zipkinProperties;
|
||||
|
||||
@Test
|
||||
public void should_propagate_spans_to_zipkin() throws Exception {
|
||||
zipkin.enqueue(new MockResponse());
|
||||
@@ -85,24 +87,6 @@ public class ZipkinTests extends AbstractIntegrationTest {
|
||||
return APP_NAME;
|
||||
}
|
||||
|
||||
@Configuration
|
||||
public static class WaitUntilZipkinIsUpConfig {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
ZipkinProperties testZipkinProperties() {
|
||||
ZipkinProperties zipkinProperties = new ZipkinProperties();
|
||||
zipkinProperties.setBaseUrl(zipkin.url("/").toString());
|
||||
return zipkinProperties;
|
||||
}
|
||||
|
||||
@Bean
|
||||
Sampler sampler() {
|
||||
return Sampler.ALWAYS_SAMPLE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void spansSentToZipkin(MockWebServer zipkin, long traceId)
|
||||
throws InterruptedException {
|
||||
RecordedRequest request = zipkin.takeRequest();
|
||||
@@ -155,4 +139,22 @@ public class ZipkinTests extends AbstractIntegrationTest {
|
||||
return "random-sleep-millis";
|
||||
}
|
||||
|
||||
@Configuration
|
||||
public static class WaitUntilZipkinIsUpConfig {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
ZipkinProperties testZipkinProperties() {
|
||||
ZipkinProperties zipkinProperties = new ZipkinProperties();
|
||||
zipkinProperties.setBaseUrl(zipkin.url("/").toString());
|
||||
return zipkinProperties;
|
||||
}
|
||||
|
||||
@Bean
|
||||
Sampler sampler() {
|
||||
return Sampler.ALWAYS_SAMPLE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
* Copyright 2013-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,6 +18,7 @@ package sample;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
Reference in New Issue
Block a user