-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Labels
type: regressionA regression from a previous releaseA regression from a previous release
Milestone
Description
#47272 added back the previous EnvironmentPostProcessor in deprecated form, but the implementation (3a9ab15) seems incomplete.
The following fails:
import org.junit.jupiter.api.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.bootstrap.ConfigurableBootstrapContext;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.boot.logging.DeferredLogFactory;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.util.Assert;
@SpringBootTest
class DemoApplicationTests {
@Test
void contextLoads() {
}
static class DeprecatedEnvironmentPostProcessor implements EnvironmentPostProcessor {
public DeprecatedEnvironmentPostProcessor(DeferredLogFactory logFactory, ConfigurableBootstrapContext bootstrapContext) {
Assert.notNull(logFactory, "logFactory must not be null");
Assert.notNull(bootstrapContext, "bootstrapContext must not be null");
}
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
}
}
}I had expected that the deprecated EnvironmentPostProcessor continue to work, but fails due to null constructor arguments.
Looks like the call to load the deprecated EnvironmentPostProcessor missed providing the ArgumentResolver as it does for the non-deprecated variant:
Line 55 in c7ec1fa
| postProcessors.addAll(this.loader.load(EnvironmentPostProcessor.class, argumentResolver)); |
Line 63 in c7ec1fa
| return this.loader.load(org.springframework.boot.env.EnvironmentPostProcessor.class); |
Metadata
Metadata
Assignees
Labels
type: regressionA regression from a previous releaseA regression from a previous release