From 204dd29c51dce650dec81ede1e6f9f95055dbcb4 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 17 Jun 2021 11:54:24 +0100 Subject: [PATCH] Fix test on Windows See gh-26821 --- .../analyzer/BeanNotOfRequiredTypeFailureAnalyzerTests.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BeanNotOfRequiredTypeFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BeanNotOfRequiredTypeFailureAnalyzerTests.java index 38b35dde38c..39fa0d576b8 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BeanNotOfRequiredTypeFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BeanNotOfRequiredTypeFailureAnalyzerTests.java @@ -47,9 +47,11 @@ class BeanNotOfRequiredTypeFailureAnalyzerTests { assertThat(analysis.getDescription()).startsWith("The bean 'asyncBean'"); assertThat(analysis.getDescription()) .containsPattern("The bean is of type '" + AsyncBean.class.getPackage().getName() + ".\\$Proxy.*'"); - assertThat(analysis.getDescription()).contains("and implements:\n\t" + SomeInterface.class.getName()); + assertThat(analysis.getDescription()) + .contains(String.format("and implements:%n\t") + SomeInterface.class.getName()); assertThat(analysis.getDescription()).contains("Expected a bean of type '" + AsyncBean.class.getName() + "'"); - assertThat(analysis.getDescription()).contains("which implements:\n\t" + SomeInterface.class.getName()); + assertThat(analysis.getDescription()) + .contains(String.format("which implements:%n\t") + SomeInterface.class.getName()); } private FailureAnalysis performAnalysis(Class configuration) {