Skip to content

Commit 0f0aa46

Browse files
committed
Delete unnecessary PropertySourcesPlaceholderConfigurer beans
Issue: SPR-14140
1 parent 7a01771 commit 0f0aa46

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

spring-test/src/test/java/org/springframework/test/context/env/InlinedPropertiesOverridePropertiesFilesTestPropertySourceTests.java

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,9 +21,7 @@
2121

2222
import org.springframework.beans.factory.annotation.Autowired;
2323
import org.springframework.beans.factory.annotation.Value;
24-
import org.springframework.context.annotation.Bean;
2524
import org.springframework.context.annotation.Configuration;
26-
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
2725
import org.springframework.core.env.Environment;
2826
import org.springframework.test.context.ContextConfiguration;
2927
import org.springframework.test.context.TestPropertySource;
@@ -59,11 +57,6 @@ public void inlinedPropertyOverridesValueFromPropertiesFile() {
5957

6058
@Configuration
6159
static class Config {
62-
63-
@Bean
64-
public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
65-
return new PropertySourcesPlaceholderConfigurer();
66-
}
6760
}
6861

6962
}

spring-test/src/test/java/org/springframework/test/context/junit/jupiter/TestConfig.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
1919
import org.springframework.context.annotation.Bean;
2020
import org.springframework.context.annotation.Configuration;
2121
import org.springframework.context.annotation.Primary;
22-
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
2322
import org.springframework.test.context.junit.jupiter.comics.Cat;
2423
import org.springframework.test.context.junit.jupiter.comics.Dog;
2524
import org.springframework.test.context.junit.jupiter.comics.Person;
@@ -33,11 +32,6 @@
3332
@Configuration
3433
public class TestConfig {
3534

36-
@Bean
37-
static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
38-
return new PropertySourcesPlaceholderConfigurer();
39-
}
40-
4135
@Bean
4236
Person dilbert() {
4337
return new Person("Dilbert");

spring-test/src/test/java/org/springframework/test/context/junit4/aci/annotation/PropertySourcesInitializerTests.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@
2525
import org.springframework.context.ConfigurableApplicationContext;
2626
import org.springframework.context.annotation.Bean;
2727
import org.springframework.context.annotation.Configuration;
28-
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
2928
import org.springframework.core.env.PropertySource;
3029
import org.springframework.mock.env.MockPropertySource;
3130
import org.springframework.test.context.ContextConfiguration;
@@ -48,8 +47,7 @@ public class PropertySourcesInitializerTests {
4847
static class Config {
4948

5049
@Value("${enigma}")
51-
// If the PropertySourcesPlaceholderConfigurer is not configured as a
52-
// static @Bean, then the following can be used to directly access the
50+
// The following can also be used to directly access the
5351
// environment instead of relying on placeholder replacement.
5452
// @Value("#{ environment['enigma'] }")
5553
private String enigma;
@@ -60,10 +58,6 @@ public String enigma() {
6058
return enigma;
6159
}
6260

63-
@Bean
64-
public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
65-
return new PropertySourcesPlaceholderConfigurer();
66-
}
6761
}
6862

6963

0 commit comments

Comments
 (0)