Merge branch '6.0.x'

This commit is contained in:
Juergen Hoeller
2023-07-19 01:26:05 +02:00
9 changed files with 23 additions and 21 deletions

View File

@@ -21,8 +21,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
/**
* Simple {@link ConfigurableEnvironment} implementation exposing
* {@link #setProperty(String, String)} and {@link #withProperty(String, String)}
* methods for testing purposes.
* {@link #setProperty} and {@link #withProperty} methods for testing purposes.
*
* @author Chris Beams
* @author Sam Brannen
@@ -33,6 +32,7 @@ public class MockEnvironment extends AbstractEnvironment {
private final MockPropertySource propertySource = new MockPropertySource();
/**
* Create a new {@code MockEnvironment} with a single {@link MockPropertySource}.
*/
@@ -40,6 +40,7 @@ public class MockEnvironment extends AbstractEnvironment {
getPropertySources().addLast(this.propertySource);
}
/**
* Set a property on the underlying {@link MockPropertySource} for this environment.
*/

View File

@@ -48,6 +48,7 @@ public class MockPropertySource extends PropertiesPropertySource {
*/
public static final String MOCK_PROPERTIES_PROPERTY_SOURCE_NAME = "mockProperties";
/**
* Create a new {@code MockPropertySource} named {@value #MOCK_PROPERTIES_PROPERTY_SOURCE_NAME}
* that will maintain its own internal {@link Properties} instance.
@@ -84,6 +85,7 @@ public class MockPropertySource extends PropertiesPropertySource {
super(name, properties);
}
/**
* Set the given property on the underlying {@link Properties} object.
*/
@@ -97,7 +99,7 @@ public class MockPropertySource extends PropertiesPropertySource {
* @return this {@link MockPropertySource} instance
*/
public MockPropertySource withProperty(String name, Object value) {
this.setProperty(name, value);
setProperty(name, value);
return this;
}