From 47e8f6168f73688e2e62651e9bd401362b68bb81 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Wed, 10 Jan 2024 09:21:03 +0100 Subject: [PATCH] Polish "Fix error mark position for PatternParseException" See gh-38944 --- .../analyzer/PatternParseFailureAnalyzerTests.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/PatternParseFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/PatternParseFailureAnalyzerTests.java index 4b4b55eefb4..87eb14b67d2 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/PatternParseFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/PatternParseFailureAnalyzerTests.java @@ -36,14 +36,11 @@ class PatternParseFailureAnalyzerTests { @Test void patternParseFailureQuotesPattern() { FailureAnalysis failureAnalysis = performAnalysis("/spring/**/framework"); - assertThat(failureAnalysis.getDescription()).contains(""" - Invalid mapping pattern detected: - /spring/**/framework - ^ - """); + assertThat(failureAnalysis.getDescription()) + .contains("Invalid mapping pattern detected:\n" + "/spring/**/framework\n" + " ^"); assertThat(failureAnalysis.getAction()) - .contains("Fix this pattern in your application or switch to the legacy parser" - + " implementation with 'spring.mvc.pathmatch.matching-strategy=ant_path_matcher'."); + .contains("Fix this pattern in your application or switch to the legacy parser" + + " implementation with 'spring.mvc.pathmatch.matching-strategy=ant_path_matcher'."); } private FailureAnalysis performAnalysis(String pattern) {