From 3e3be2b407150544cb546f4bc3be394aa805a41a Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 10 Jun 2025 11:07:38 +0100 Subject: [PATCH] Polish --- ...eManagementChildContextConfigurationTests.java | 14 ++++++-------- ...tManagementChildContextConfigurationTests.java | 15 ++++++--------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationTests.java index 10cdda011b9..65290097c06 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/reactive/ReactiveManagementChildContextConfigurationTests.java +++ b/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 { @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())); } } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfigurationTests.java index e4c3e3d051d..69dd4b2abcd 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfigurationTests.java +++ b/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 { @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())); } }