spring_reference/IV. Spring Boot features/35.4.2. EnvironmentTestUtil...

283 B
Raw Blame History

35.4.2. EnvironmentTestUtils

EnvironmentTestUtils允许你快速添加属性到一个ConfigurableEnvironment或ConfigurableApplicationContext。只需简单的使用key=value字符串调用它

EnvironmentTestUtils.addEnvironment(env, "org=Spring", "name=Boot");