From 2c4f39045fb792981567aa3c6196abea5cb66b88 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 8 Nov 2016 14:36:58 +0000 Subject: [PATCH] Stop relying on Artemis's on-demand queue creation in CLI JMS test Artemis's on-demand queue cretaion appears to be rather flakey, sometimes failing with a NullPointerException. This commit ensures that the queue used by the sample is created during start up rather than on demand. This will hopefully make the test that runs the sample more robust. Closes gh-7346 --- .../boot/cli/SampleIntegrationTests.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java index cdf05b8414..55cedb6027 100644 --- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java +++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java @@ -144,8 +144,15 @@ public class SampleIntegrationTests { @Test public void jmsSample() throws Exception { - String output = this.cli.run("jms.groovy"); - assertThat(output).contains("Received Greetings from Spring Boot via Artemis"); + System.setProperty("spring.artemis.embedded.queues", "spring-boot"); + try { + String output = this.cli.run("jms.groovy"); + assertThat(output) + .contains("Received Greetings from Spring Boot via Artemis"); + } + finally { + System.clearProperty("spring.artemis.embedded.queues"); + } } @Test