public final class TestPropertyValues extends Object
Environment or to the system environment.| Modifier and Type | Class and Description | 
|---|---|
| static class  | TestPropertyValues.PairA single name value pair. | 
| static class  | TestPropertyValues.TypeThe type of property source. | 
| Modifier and Type | Method and Description | 
|---|---|
| TestPropertyValues | and(String... pairs)Builder method to add more properties. | 
| void | applyTo(org.springframework.context.ConfigurableApplicationContext context)Add the properties from the underlying map to the environment owned by an
 ApplicationContext. | 
| void | applyTo(org.springframework.core.env.ConfigurableEnvironment environment)Add the properties from the underlying map to the environment. | 
| void | applyTo(org.springframework.core.env.ConfigurableEnvironment environment,
TestPropertyValues.Type type)Add the properties from the underlying map to the environment using the specified
property source type. | 
| void | applyTo(org.springframework.core.env.ConfigurableEnvironment environment,
TestPropertyValues.Type type,
String name)Add the properties from the underlying map to the environment using the specified
property source type and name. | 
| <T> T | applyToSystemProperties(Callable<T> call)Add the properties to the  system propertiesfor the
duration of thecall, restoring previous values when the call completes. | 
| static TestPropertyValues | empty()Return an empty  TestPropertyValuesinstance. | 
| static TestPropertyValues | of(Iterable<String> pairs)Return a new  TestPropertyValueswith the underlying map populated with the
given property pairs. | 
| static TestPropertyValues | of(Stream<String> pairs)Return a new  TestPropertyValueswith the underlying map populated with the
given property pairs. | 
| static TestPropertyValues | of(String... pairs)Return a new  TestPropertyValueswith the underlying map populated with the
given property pairs. | 
public TestPropertyValues and(String... pairs)
pairs - the property pairs to addTestPropertyValues instancepublic void applyTo(org.springframework.context.ConfigurableApplicationContext context)
ApplicationContext.context - the context with an environment to modifypublic void applyTo(org.springframework.core.env.ConfigurableEnvironment environment)
MapPropertySource.environment - the environment that needs to be modifiedpublic void applyTo(org.springframework.core.env.ConfigurableEnvironment environment,
                    TestPropertyValues.Type type)
environment - the environment that needs to be modifiedtype - the type of PropertySource to be added. See TestPropertyValues.Typepublic void applyTo(org.springframework.core.env.ConfigurableEnvironment environment,
                    TestPropertyValues.Type type,
                    String name)
environment - the environment that needs to be modifiedtype - the type of PropertySource to be added. See TestPropertyValues.Typename - the name for the property sourcepublic <T> T applyToSystemProperties(Callable<T> call)
system properties for the
duration of the call, restoring previous values when the call completes.T - the result typecall - the call to makepublic static TestPropertyValues of(String... pairs)
TestPropertyValues with the underlying map populated with the
given property pairs. Name-value pairs can be specified with colon (":") or equals
("=") separators.pairs - the name-value pairs for properties that need to be added to the
environmentpublic static TestPropertyValues of(Iterable<String> pairs)
TestPropertyValues with the underlying map populated with the
given property pairs. Name-value pairs can be specified with colon (":") or equals
("=") separators.pairs - the name-value pairs for properties that need to be added to the
environmentpublic static TestPropertyValues of(Stream<String> pairs)
TestPropertyValues with the underlying map populated with the
given property pairs. Name-value pairs can be specified with colon (":") or equals
("=") separators.pairs - the name-value pairs for properties that need to be added to the
environmentpublic static TestPropertyValues empty()
TestPropertyValues instance.Copyright © 2019 Pivotal Software, Inc.. All rights reserved.