how to run/turn off selective tests based on profiles in spring boot

前端 未结 5 959
梦谈多话
梦谈多话 2020-12-10 13:47

I have a spring-boot application for which I am writing IT tests.

The data for the tests comes from application-dev.properties when I activ

5条回答
  •  臣服心动
    2020-12-10 14:16

    You would want to use the @IfProfileValue annotation. Unfortunately it doesn't work directly on the active profiles but it can read a property so if you only define a specific property within the profiles that you want to run the test on then you can use that annotation on that specific property.

    http://docs.spring.io/spring/docs/current/spring-framework-reference/html/integration-testing.html#integration-testing-annotations-junit

提交回复
热议问题