Refactor docker compose so default launches everything
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package example;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.sleuth.zipkin.stream.EnableZipkinStreamServer;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableZipkinStreamServer
|
||||
public class ZipkinStreamServerApplication {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication.run(ZipkinStreamServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
server:
|
||||
port: 9411
|
||||
|
||||
spring:
|
||||
rabbitmq:
|
||||
host: ${RABBIT_HOST:localhost}
|
||||
datasource:
|
||||
schema: classpath:/mysql.sql
|
||||
url: jdbc:mysql://${MYSQL_HOST:localhost}/test
|
||||
username: root
|
||||
password: root
|
||||
# Switch this on to create the schema on startup:
|
||||
initialize: true
|
||||
continueOnError: true
|
||||
sleuth:
|
||||
enabled: false
|
||||
zipkin:
|
||||
store:
|
||||
type: mysql # default is inMemory
|
||||
|
||||
---
|
||||
spring:
|
||||
profiles: test
|
||||
zipkin:
|
||||
store:
|
||||
type: mem # default is inMemory
|
||||
@@ -0,0 +1,31 @@
|
||||
package example;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.IntegrationTest;
|
||||
import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import example.ZipkinStreamServerApplication;
|
||||
import io.zipkin.SpanStore;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = ZipkinStreamServerApplication.class)
|
||||
@IntegrationTest({ "server.port=0", "spring.datasource.initialize=true" })
|
||||
@ActiveProfiles("test")
|
||||
public class ZipkinServerApplicationTests {
|
||||
|
||||
@Autowired
|
||||
private SpanStore store;
|
||||
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
int count = this.store.getServiceNames().size();
|
||||
assertEquals(0, count);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
drop table zipkin_spans;
|
||||
drop table zipkin_annotations;
|
||||
drop table zipkin_binary_annotations;
|
||||
drop table zipkin_dependencies;
|
||||
drop table zipkin_dependency_links;
|
||||
Reference in New Issue
Block a user