Home > database >  My test cases in spring boot app are reading from main application.yaml file instead of application-
My test cases in spring boot app are reading from main application.yaml file instead of application-

Time:11-15

I am using profiles("test") in my test class but then also while running spring boot test cases it uses my yaml from src/main/resources instead from test/resources/application-test.yaml.

I used @ActiveProfiles annotation and I expect to pick the data from test folder yaml file.

enter image description here

CodePudding user response:

src/test/main/resources is "weird"! To fix the issue move resources (and java) folder to src/test/, to conform with "maven project structure".

  • Related