diff --git a/module/spring-boot-grpc-server/src/main/java/org/springframework/boot/grpc/server/autoconfigure/health/AutoConfiguredHealthCheckedGrpcComponents.java b/module/spring-boot-grpc-server/src/main/java/org/springframework/boot/grpc/server/autoconfigure/health/AutoConfiguredHealthCheckedGrpcComponents.java index 4ded582191d..cb088ecb0e9 100644 --- a/module/spring-boot-grpc-server/src/main/java/org/springframework/boot/grpc/server/autoconfigure/health/AutoConfiguredHealthCheckedGrpcComponents.java +++ b/module/spring-boot-grpc-server/src/main/java/org/springframework/boot/grpc/server/autoconfigure/health/AutoConfiguredHealthCheckedGrpcComponents.java @@ -68,10 +68,8 @@ class AutoConfiguredHealthCheckedGrpcComponents implements HealthCheckedGrpcComp () -> StatusAggregator.of(properties.getStatus().getOrder())); StatusMapper statusMapper = getNonQualifiedBean(beanFactory, StatusMapper.class, () -> StatusMapper.of(properties.getStatus().getMapping())); - this.server = (properties.isIncludeOverallHealth()) - ? new AutoConfiguredHealthCheckedGrpcComponent(HealthContributorMembership.always(), statusAggregator, - statusMapper) - : null; + this.server = (properties.isIncludeOverallHealth()) ? new AutoConfiguredHealthCheckedGrpcComponent( + HealthContributorMembership.always(), statusAggregator, statusMapper) : null; this.services = createServices(properties.getService(), beanFactory, statusAggregator, statusMapper); } diff --git a/module/spring-boot-grpc-server/src/test/java/org/springframework/boot/grpc/server/autoconfigure/health/GrpcServerHealthAutoConfigurationTests.java b/module/spring-boot-grpc-server/src/test/java/org/springframework/boot/grpc/server/autoconfigure/health/GrpcServerHealthAutoConfigurationTests.java index 86913e45a6a..172b8a64a03 100644 --- a/module/spring-boot-grpc-server/src/test/java/org/springframework/boot/grpc/server/autoconfigure/health/GrpcServerHealthAutoConfigurationTests.java +++ b/module/spring-boot-grpc-server/src/test/java/org/springframework/boot/grpc/server/autoconfigure/health/GrpcServerHealthAutoConfigurationTests.java @@ -304,12 +304,13 @@ class GrpcServerHealthAutoConfigurationTests { @Test void whenIncludeOverallHealthIsFalseDoesNotReportOverallHealth() { - this.contextRunner.withPropertyValues("spring.grpc.server.health.include-overall-health=false").run((context) -> { - GrpcServerHealth serverHealth = context.getBean(GrpcServerHealth.class); - Map result = new LinkedHashMap<>(); - serverHealth.update(result::put); - assertThat(result).isEmpty(); - }); + this.contextRunner.withPropertyValues("spring.grpc.server.health.include-overall-health=false") + .run((context) -> { + GrpcServerHealth serverHealth = context.getBean(GrpcServerHealth.class); + Map result = new LinkedHashMap<>(); + serverHealth.update(result::put); + assertThat(result).isEmpty(); + }); } @Test