diff --git a/pom.xml b/pom.xml index 997280b..29bcd29 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ stream-bus turbine turbine-amqp + vanilla zipkin zuul zuul-config-discovery diff --git a/vanilla/README.md b/vanilla/README.md new file mode 100644 index 0000000..1d6dce9 --- /dev/null +++ b/vanilla/README.md @@ -0,0 +1,2 @@ +Simple "vanilla" Spring Cloud app. Just a web app with +Cloud context features (/restart, /refresh etc.) diff --git a/vanilla/pom.xml b/vanilla/pom.xml new file mode 100644 index 0000000..2b7db27 --- /dev/null +++ b/vanilla/pom.xml @@ -0,0 +1,112 @@ + + + 4.0.0 + + org.springframework.cloud.sample + spring-cloud-sample-vanilla + Brixton.BUILD-SNAPSHOT + jar + + spring-cloud-sample-vanilla + Demo project for Spring Cloud + + + org.springframework.boot + spring-boot-starter-parent + 1.3.5.RELEASE + + + + + + + org.springframework.cloud + spring-cloud-dependencies + Brixton.BUILD-SNAPSHOT + pom + import + + + + + + UTF-8 + 1.8 + + + + + + + maven-deploy-plugin + + true + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + org.springframework.cloud + spring-cloud-starter + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + diff --git a/vanilla/src/main/java/demo/VanillaApplication.java b/vanilla/src/main/java/demo/VanillaApplication.java new file mode 100644 index 0000000..0c76535 --- /dev/null +++ b/vanilla/src/main/java/demo/VanillaApplication.java @@ -0,0 +1,23 @@ +package demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.context.annotation.Bean; + +/** + * @author Dave Syer + */ +@SpringBootApplication +public class VanillaApplication { + + @Bean + @RefreshScope + public Runnable runner() { + return () -> System.err.println("*****"); + } + + public static void main(String[] args) { + SpringApplication.run(VanillaApplication.class, args); + } +} diff --git a/vanilla/src/main/resources/application.yml b/vanilla/src/main/resources/application.yml new file mode 100644 index 0000000..8cdbe30 --- /dev/null +++ b/vanilla/src/main/resources/application.yml @@ -0,0 +1,3 @@ +spring: + application: + name: vanilla diff --git a/vanilla/src/test/java/demo/VanillaApplicationTests.java b/vanilla/src/test/java/demo/VanillaApplicationTests.java new file mode 100644 index 0000000..e2aa59b --- /dev/null +++ b/vanilla/src/test/java/demo/VanillaApplicationTests.java @@ -0,0 +1,28 @@ +package demo; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.boot.test.WebIntegrationTest; +import org.springframework.cloud.context.refresh.ContextRefresher; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@RunWith(SpringJUnit4ClassRunner.class) +@SpringApplicationConfiguration(classes = VanillaApplication.class) +@WebIntegrationTest(randomPort = true) +@DirtiesContext +public class VanillaApplicationTests { + + @Autowired + private ContextRefresher refresher; + + @Test + public void contextLoads() throws Exception { + assertNotNull(refresher); + } + +}