From eed6e199fc8ca478e708130eb377f6ef0cb091f8 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 22 Aug 2023 10:33:03 +0200 Subject: [PATCH] Polish "Detect logback config location as xml if path ends with .xml" See gh-37039 --- .../boot/logging/logback/LogbackLoggingSystemTests.java | 2 +- .../spring-boot/src/test/resources/logback-invalid-format.txt | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 spring-boot-project/spring-boot/src/test/resources/logback-invalid-format.txt diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java index 1fc870d66f..c9210207a8 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/logback/LogbackLoggingSystemTests.java @@ -691,7 +691,7 @@ class LogbackLoggingSystemTests extends AbstractLoggingSystemTests { void whenConfigLocationIsNotXmlThenIllegalArgumentExceptionShouldBeThrown() { this.loggingSystem.beforeInitialize(); assertThatIllegalStateException() - .isThrownBy(() -> initialize(this.initializationContext, "file:///logback-nonexistent.txt", + .isThrownBy(() -> initialize(this.initializationContext, "classpath:logback-invalid-format.txt", getLogFile(tmpDir() + "/tmp.log", null))) .satisfies((ex) -> assertThat(ex.getCause()).isInstanceOf(IllegalArgumentException.class) .hasMessageStartingWith("Unsupported file extension")); diff --git a/spring-boot-project/spring-boot/src/test/resources/logback-invalid-format.txt b/spring-boot-project/spring-boot/src/test/resources/logback-invalid-format.txt new file mode 100644 index 0000000000..e69de29bb2