0

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)

Az.MaYo
  • 1,044
  • 10
  • 23

1 Answers1

1

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/

efire-net
  • 52
  • 4