From 77b503075d626ab7768e139f0edf881efbdb73ec Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Wed, 28 Aug 2024 10:36:31 +0200 Subject: [PATCH] Add test case to test if spring.main properties can be bound See https://github.com/spring-projects/spring-boot/issues/42038 --- .../configprops/ConfigPropsApplicationAotTests.java | 8 ++++++++ .../src/main/resources/application.yaml | 2 ++ 2 files changed, 10 insertions(+) diff --git a/boot/configuration-properties/src/appTest/java/com/example/configprops/ConfigPropsApplicationAotTests.java b/boot/configuration-properties/src/appTest/java/com/example/configprops/ConfigPropsApplicationAotTests.java index bd681413..e498ef19 100644 --- a/boot/configuration-properties/src/appTest/java/com/example/configprops/ConfigPropsApplicationAotTests.java +++ b/boot/configuration-properties/src/appTest/java/com/example/configprops/ConfigPropsApplicationAotTests.java @@ -225,4 +225,12 @@ void shouldImportConfig(AssertableOutput output) { } + @Test + void shouldNotPrintBanner(AssertableOutput output) { + Awaitility.await() + .atMost(Duration.ofSeconds(10)) + .untilAsserted(() -> assertThat(output).hasSingleLineContaining("Started ConfigPropsApplication in")); + assertThat(output).hasNoLinesContaining(":: Spring Boot ::"); + } + } diff --git a/boot/configuration-properties/src/main/resources/application.yaml b/boot/configuration-properties/src/main/resources/application.yaml index 3ef7a84b..b12f57bb 100644 --- a/boot/configuration-properties/src/main/resources/application.yaml +++ b/boot/configuration-properties/src/main/resources/application.yaml @@ -45,3 +45,5 @@ app.record: spring: config: import: test.yaml + main: + banner-mode: off