Browse Source

Merge branch '3.3.x' into 3.4.x

Closes gh-44684
pull/44789/head
Stéphane Nicoll 11 months ago
parent
commit
322191f288
  1. 5
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java
  2. 3
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfigurationTests.java
  3. 2
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureBefore.java
  4. 2
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystem.java
  5. 12
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java
  6. 3
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContextTests.java
  7. 3
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java
  8. 4
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java

5
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java

@ -16,8 +16,6 @@ @@ -16,8 +16,6 @@
package org.springframework.boot.actuate.autoconfigure.data.redis;
import java.util.Map;
import reactor.core.publisher.Flux;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
@ -51,8 +49,7 @@ import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory; @@ -51,8 +49,7 @@ import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
public class RedisReactiveHealthContributorAutoConfiguration extends
CompositeReactiveHealthContributorConfiguration<RedisReactiveHealthIndicator, ReactiveRedisConnectionFactory> {
RedisReactiveHealthContributorAutoConfiguration(
Map<String, ReactiveRedisConnectionFactory> redisConnectionFactories) {
RedisReactiveHealthContributorAutoConfiguration() {
super(RedisReactiveHealthIndicator::new);
}

3
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/AbstractCompositeHealthContributorConfigurationTests.java

@ -123,13 +123,11 @@ abstract class AbstractCompositeHealthContributorConfigurationTests<C, I extends @@ -123,13 +123,11 @@ abstract class AbstractCompositeHealthContributorConfigurationTests<C, I extends
@Bean(defaultCandidate = false)
TestBean nonDefault() {
return new TestBean();
}
@Bean(autowireCandidate = false)
TestBean nonAutowire() {
return new TestBean();
}
}
@ -145,7 +143,6 @@ abstract class AbstractCompositeHealthContributorConfigurationTests<C, I extends @@ -145,7 +143,6 @@ abstract class AbstractCompositeHealthContributorConfigurationTests<C, I extends
@Bean(autowireCandidate = false)
TestBean nonAutowire() {
return new TestBean();
}
}

2
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureBefore.java

@ -44,7 +44,7 @@ import org.springframework.context.annotation.DependsOn; @@ -44,7 +44,7 @@ import org.springframework.context.annotation.DependsOn;
public @interface AutoConfigureBefore {
/**
* The auto-configure classes that should have not yet been applied.
* The auto-configuration classes that should have not yet been applied.
* @return the classes
*/
Class<?>[] value() default {};

2
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystem.java

@ -447,7 +447,7 @@ public class Log4J2LoggingSystem extends AbstractLoggingSystem { @@ -447,7 +447,7 @@ public class Log4J2LoggingSystem extends AbstractLoggingSystem {
super.cleanUp();
LoggerContext loggerContext = getLoggerContext();
markAsUninitialized(loggerContext);
StatusConsoleListener listener = (StatusConsoleListener) getLoggerContext().getObject(STATUS_LISTENER_KEY);
StatusConsoleListener listener = (StatusConsoleListener) loggerContext.getObject(STATUS_LISTENER_KEY);
if (listener != null) {
StatusLogger.getLogger().removeListener(listener);
loggerContext.removeObject(STATUS_LISTENER_KEY);

12
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java

@ -146,15 +146,15 @@ public class ServletWebServerApplicationContext extends GenericWebApplicationCon @@ -146,15 +146,15 @@ public class ServletWebServerApplicationContext extends GenericWebApplicationCon
super.refresh();
}
catch (RuntimeException ex) {
try {
WebServer webServer = this.webServer;
if (webServer != null) {
WebServer webServer = this.webServer;
if (webServer != null) {
try {
webServer.stop();
webServer.destroy();
}
}
catch (RuntimeException stopOrDestroyEx) {
ex.addSuppressed(stopOrDestroyEx);
catch (RuntimeException stopOrDestroyEx) {
ex.addSuppressed(stopOrDestroyEx);
}
}
throw ex;
}

3
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContextTests.java

@ -44,6 +44,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -44,6 +44,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import static org.mockito.BDDMockito.then;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
/**
@ -148,7 +149,7 @@ class ReactiveWebServerApplicationContextTests { @@ -148,7 +149,7 @@ class ReactiveWebServerApplicationContextTests {
.withStackTraceContaining("WebServer has failed to stop");
WebServer webServer = this.context.getWebServer();
then(webServer).should().stop();
then(webServer).should(times(0)).destroy();
then(webServer).should(never()).destroy();
}
@Test

3
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContextTests.java

@ -86,6 +86,7 @@ import static org.mockito.BDDMockito.willThrow; @@ -86,6 +86,7 @@ import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Mockito.atMost;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.withSettings;
@ -236,7 +237,7 @@ class ServletWebServerApplicationContextTests { @@ -236,7 +237,7 @@ class ServletWebServerApplicationContextTests {
.withStackTraceContaining("WebServer has failed to stop");
WebServer webServer = this.context.getWebServer();
then(webServer).should().stop();
then(webServer).should(times(0)).destroy();
then(webServer).should(never()).destroy();
}
@Test

4
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java

@ -169,7 +169,7 @@ import static org.mockito.ArgumentMatchers.any; @@ -169,7 +169,7 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.then;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.never;
/**
* Base for testing classes that extends {@link AbstractServletWebServerFactory}.
@ -1193,7 +1193,7 @@ public abstract class AbstractServletWebServerFactoryTests { @@ -1193,7 +1193,7 @@ public abstract class AbstractServletWebServerFactoryTests {
this.webServer = getFactory().getWebServer((servletContext) -> servletContext.addListener(listener));
this.webServer.start();
this.webServer.stop();
then(listener).should(times(0)).contextDestroyed(any(ServletContextEvent.class));
then(listener).should(never()).contextDestroyed(any(ServletContextEvent.class));
}
@Test

Loading…
Cancel
Save