类 EnvironmentTestUtils


  • public abstract class EnvironmentTestUtils
    extends Object
    Test utilities for setting environment values.
    从以下版本开始:
    1.4.0
    • 方法详细资料

      • addEnvironment

        public static void addEnvironment​(org.springframework.context.ConfigurableApplicationContext context,
                                          String... pairs)
        Add additional (high priority) values to an Environment owned by an ApplicationContext. Name-value pairs can be specified with colon (":") or equals ("=") separators.
        参数:
        context - the context with an environment to modify
        pairs - the name:value pairs
      • addEnvironment

        public static void addEnvironment​(org.springframework.core.env.ConfigurableEnvironment environment,
                                          String... pairs)
        Add additional (high priority) values to an Environment. Name-value pairs can be specified with colon (":") or equals ("=") separators.
        参数:
        environment - the environment to modify
        pairs - the name:value pairs
      • addEnvironment

        public static void addEnvironment​(String name,
                                          org.springframework.core.env.ConfigurableEnvironment environment,
                                          String... pairs)
        Add additional (high priority) values to an Environment. Name-value pairs can be specified with colon (":") or equals ("=") separators.
        参数:
        environment - the environment to modify
        name - the property source name
        pairs - the name:value pairs