Reputation: 1106
I have integrated ActiveMQ with my Spring-Boot application and it's working fine. But When I'm trying to create Integration test for my @JmsListener with Embedded ActiveMQ it's only looking for external ActiveMQ not internal.
So my Case always failed. Is there anyway to override default application.yml with application-test.yml so my Receiver call which have @JmsListner look for embedded-broker url not external one (which I have declared in application.yml)
Upvotes: 0
Views: 437
Reputation: 52
To override, use @TestPropertySource
Example:
@TestPropertySource(locations = "classpath:application-test.yml")
public class IntegrationClass {
Your application-test.yml should be placed in src/test/resources/
Upvotes: 1