public final class TestPropertyValues extends Object
PropertySource to be added can be specified by TestPropertyValues.Type.| Modifier and Type | Class and Description |
|---|---|
static class |
TestPropertyValues.Type
The type of property source.
|
| Modifier and Type | Method and Description |
|---|---|
TestPropertyValues |
and(String key,
String value)
Builder method to append another property to the underlying map of properties.
|
void |
applyTo(ConfigurableApplicationContext context)
Add the properties from the underlying map to the environment owned by an
ApplicationContext. |
void |
applyTo(ConfigurableEnvironment environment)
Add the properties from the underlying map to the environment.
|
void |
applyTo(ConfigurableEnvironment environment,
TestPropertyValues.Type type)
Add the properties from the underlying map to the environment using the specified
property source type.
|
void |
applyTo(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.
|
static TestPropertyValues |
of(String... pairs)
Return a new
TestPropertyValues with the underlying map populated with the
given property pairs. |
public TestPropertyValues and(String key, String value)
key - The property keyvalue - The property valueTestPropertyValuespublic void applyTo(ConfigurableApplicationContext context)
ApplicationContext.context - the context with an environment to modifypublic void applyTo(ConfigurableEnvironment environment)
MapPropertySource.environment - the environment that needs to be modifiedpublic void applyTo(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(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 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 key value pairs for properties that need to be added to the
environmentCopyright © 2017 Pivotal Software, Inc.. All rights reserved.