Browse Source

Merge branch 'main' into 4.0.x

pull/45939/head
Andy Wilkinson 8 months ago
parent
commit
b313d52829
  1. 14
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationTests.java
  2. 15
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfigurationTests.java

14
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationTests.java

@ -51,21 +51,19 @@ class ReactiveManagementChildContextConfigurationTests { @@ -51,21 +51,19 @@ class ReactiveManagementChildContextConfigurationTests {
@Test
// gh-45857
void failsWithoutManagementServerPropertiesBeanFromParent() {
new ReactiveWebApplicationContextRunner().run((parent) -> {
new ReactiveWebApplicationContextRunner().withParent(parent)
new ReactiveWebApplicationContextRunner()
.run((parent) -> new ReactiveWebApplicationContextRunner().withParent(parent)
.withUserConfiguration(ReactiveManagementChildContextConfiguration.class)
.run((context) -> assertThat(context).hasFailed());
});
.run((context) -> assertThat(context).hasFailed()));
}
@Test
// gh-45857
void succeedsWithManagementServerPropertiesBeanFromParent() {
new ReactiveWebApplicationContextRunner().withBean(ManagementServerProperties.class).run((parent) -> {
new ReactiveWebApplicationContextRunner().withParent(parent)
new ReactiveWebApplicationContextRunner().withBean(ManagementServerProperties.class)
.run((parent) -> new ReactiveWebApplicationContextRunner().withParent(parent)
.withUserConfiguration(ReactiveManagementChildContextConfiguration.class)
.run((context) -> assertThat(context).hasNotFailed());
});
.run((context) -> assertThat(context).hasNotFailed()));
}
}

15
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfigurationTests.java

@ -51,21 +51,18 @@ class ServletManagementChildContextConfigurationTests { @@ -51,21 +51,18 @@ class ServletManagementChildContextConfigurationTests {
@Test
// gh-45857
void failsWithoutManagementServerPropertiesBeanFromParent() {
new WebApplicationContextRunner().run((parent) -> {
new WebApplicationContextRunner().withParent(parent)
.withUserConfiguration(ServletManagementChildContextConfiguration.class)
.run((context) -> assertThat(context).hasFailed());
});
new WebApplicationContextRunner().run((parent) -> new WebApplicationContextRunner().withParent(parent)
.withUserConfiguration(ServletManagementChildContextConfiguration.class)
.run((context) -> assertThat(context).hasFailed()));
}
@Test
// gh-45857
void succeedsWithManagementServerPropertiesBeanFromParent() {
new WebApplicationContextRunner().withBean(ManagementServerProperties.class).run((parent) -> {
new WebApplicationContextRunner().withParent(parent)
new WebApplicationContextRunner().withBean(ManagementServerProperties.class)
.run((parent) -> new WebApplicationContextRunner().withParent(parent)
.withUserConfiguration(ServletManagementChildContextConfiguration.class)
.run((context) -> assertThat(context).hasNotFailed());
});
.run((context) -> assertThat(context).hasNotFailed()));
}
}

Loading…
Cancel
Save