spring-framework / org.springframework.mock.env

Package org.springframework.mock.env

Types

MockEnvironment

open class MockEnvironment : AbstractEnvironment

Simple ConfigurableEnvironment implementation exposing #setProperty(String, String) and #withProperty(String, String) methods for testing purposes.

MockPropertySource

open class MockPropertySource : PropertiesPropertySource

Simple PropertySource implementation for use in testing. Accepts a user-provided Properties object, or if omitted during construction, the implementation will initialize its own. The #setProperty and #withProperty methods are exposed for convenience, for example:

PropertySource<?> source = new MockPropertySource().withProperty("foo", "bar");