From becf225911f5e30928856af518f8fdecbdd3bb59 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 4 Nov 2016 20:57:37 +0000 Subject: [PATCH] Simplify CLI integration auto-config test by removing use of Artemis Artemis seems to be a bit flakey which is causing sporadic build failures, for example due to an NPE in Artemis' code. --- .../boot/cli/TestCommandIntegrationTests.java | 2 +- spring-boot-cli/test-samples/app.groovy | 17 +++++++++++++++++ .../test-samples/integration_auto_test.groovy | 10 ++++------ 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 spring-boot-cli/test-samples/app.groovy diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/TestCommandIntegrationTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/TestCommandIntegrationTests.java index bc40767515a..429a7e93857 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/TestCommandIntegrationTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/TestCommandIntegrationTests.java @@ -96,7 +96,7 @@ public class TestCommandIntegrationTests { @Test public void integrationAutoConfigTest() throws Exception { - String output = this.cli.test("integration_auto_test.groovy", "jms.groovy"); + String output = this.cli.test("integration_auto_test.groovy", "app.groovy"); assertThat(output).contains("OK (1 test)"); } diff --git a/spring-boot-cli/test-samples/app.groovy b/spring-boot-cli/test-samples/app.groovy new file mode 100644 index 00000000000..3182af1dfa2 --- /dev/null +++ b/spring-boot-cli/test-samples/app.groovy @@ -0,0 +1,17 @@ +@Configuration +class App { + + @Bean + MyService myService() { + return new MyService() + } + +} + +class MyService { + + String sayWorld() { + return "World!" + } + +} \ No newline at end of file diff --git a/spring-boot-cli/test-samples/integration_auto_test.groovy b/spring-boot-cli/test-samples/integration_auto_test.groovy index 91e22e28ca7..b5ac561cd4b 100644 --- a/spring-boot-cli/test-samples/integration_auto_test.groovy +++ b/spring-boot-cli/test-samples/integration_auto_test.groovy @@ -1,14 +1,12 @@ -import org.springframework.jms.core.JmsTemplate - -@SpringBootTest(classes=JmsExample) -class JmsTests { +@SpringBootTest(classes=App) +class AppTests { @Autowired - JmsTemplate jmsTemplate + MyService myService @Test void test() { - assertNotNull(jmsTemplate) + assertNotNull(myService) } }