Skip to content

Commit 7da42d7

Browse files
committed
Allow tests to pass when a NAME environment variable exists
Update `ConfigurationPropertiesTests` so that it will pass even if a local `NAME` environment variable is declared. Closes gh-31076
1 parent 44c979b commit 7da42d7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ void loadWhenBindingWithoutAnnotationValueShouldBind() {
254254

255255
@Test
256256
void loadWhenBindingWithDefaultsInXmlShouldBind() {
257+
removeSystemProperties();
257258
load(new Class<?>[] { BasicConfiguration.class, DefaultsInXmlConfiguration.class });
258259
BasicProperties bean = this.context.getBean(BasicProperties.class);
259260
assertThat(bean.name).isEqualTo("bar");

0 commit comments

Comments
 (0)