So I'm running an integration test/spec using configuration for an ActiveMQ in-memory broker.
SomeSpec.groovy:
@SpringApplicationConfiguration(SomeApplication.class)
@WebIntegrationTest(randomPort = true)
class SomeSpec extends Specification {
application.properties
spring.activemq.in-memory=true
spring.activemq.pooled=false
The in memory broker starts up and runs fine when I do gradle test
and also runs fine when used with gradle bootRun
at the command line. However when I run inside IntelliJ without explicitly having it run gradle test
the in memory broker does not start and the tests fail.
How can I take and advantage of the nice test/spec running features in IntelliJ but still have it initialize the in memory queue properly? I know with Grails you could run with JUnit or Grails. Is there something similar with Spring/SpringBoot so everything starts up properly.
It's probably because your config
files are not refreshed under project/out/production/config/
location.
When you run it from cmd
line, it takes the latest application.properties
, so every thing is fine.
But Idea
takes the already compiled config files, and if they are not rebuilt inside Idea
then it still loads the load configuration.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments