Skip to content

Commit 2c4f390

Browse files
committed
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
1 parent 5f44598 commit 2c4f390

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,15 @@ public void txSample() throws Exception {
144144

145145
@Test
146146
public void jmsSample() throws Exception {
147-
String output = this.cli.run("jms.groovy");
148-
assertThat(output).contains("Received Greetings from Spring Boot via Artemis");
147+
System.setProperty("spring.artemis.embedded.queues", "spring-boot");
148+
try {
149+
String output = this.cli.run("jms.groovy");
150+
assertThat(output)
151+
.contains("Received Greetings from Spring Boot via Artemis");
152+
}
153+
finally {
154+
System.clearProperty("spring.artemis.embedded.queues");
155+
}
149156
}
150157

151158
@Test

0 commit comments

Comments
 (0)