I am using the following annotations in my spring boot testing files
@RunWith(SpringRunner.class) // tells JUnit to run using Spring’s testing support. @SpringBootTest // is saying “bootstrap with Spring Boot’s support” (e.g. load application.properties and give me all the Spring Boot goodness) @AutoConfigureMockMvc When I test rest controllers, it will show java.lang.IllegalStateException: Failed to load ApplicationContext.
I checked the log, and this is caused by connection issues with JMS and database. For my rest controllers testing, I do not need any of them. But their configuration is defined in the application.properties file and it will be loaded in the SpringBootTest, how can I use a different application.properties file for the testing purpose?