您将要使用
@IfProfilevalue注释。不幸的是,它不能直接在活动配置文件上运行,而是可以读取属性,因此,如果您仅在要对其运行测试的配置文件中定义特定属性,则可以在该特定属性上使用该注释。
http://docs.spring.io/spring/docs/current/spring-framework-
reference/html/integration-testing.html#integration-testing-annotations-
junit

您将要使用
@IfProfilevalue注释。不幸的是,它不能直接在活动配置文件上运行,而是可以读取属性,因此,如果您仅在要对其运行测试的配置文件中定义特定属性,则可以在该特定属性上使用该注释。
http://docs.spring.io/spring/docs/current/spring-framework-
reference/html/integration-testing.html#integration-testing-annotations-
junit