From f1cf66163e685807d2b9d1b4ec1e861aa6d23131 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 9 Dec 2014 10:02:40 -0800 Subject: [PATCH] Fix ResourceBannerTests failures on Windows Fixes gh-2096 --- .../org/springframework/boot/ResourceBannerTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java b/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java index c3deebc70b..a584d08ee3 100644 --- a/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/ResourceBannerTests.java @@ -28,7 +28,7 @@ import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.Resource; import org.springframework.mock.env.MockEnvironment; -import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertThat; /** @@ -43,7 +43,7 @@ public class ResourceBannerTests { Resource resource = new ByteArrayResource( "banner ${a} ${spring-boot.version} ${application.version}".getBytes()); String banner = printBanner(resource, "10.2", "2.0"); - assertThat(banner, equalTo("banner 1 10.2 2.0\n")); + assertThat(banner, startsWith("banner 1 10.2 2.0\n")); } @Test @@ -51,7 +51,7 @@ public class ResourceBannerTests { Resource resource = new ByteArrayResource( "banner ${a} ${spring-boot.version} ${application.version}".getBytes()); String banner = printBanner(resource, null, null); - assertThat(banner, equalTo("banner 1 \n")); + assertThat(banner, startsWith("banner 1 \n")); } @Test @@ -60,7 +60,7 @@ public class ResourceBannerTests { "banner ${a}${spring-boot.formatted-version}${application.formatted-version}" .getBytes()); String banner = printBanner(resource, "10.2", "2.0"); - assertThat(banner, equalTo("banner 1 (v10.2) (v2.0)\n")); + assertThat(banner, startsWith("banner 1 (v10.2) (v2.0)\n")); } @Test @@ -69,7 +69,7 @@ public class ResourceBannerTests { "banner ${a}${spring-boot.formatted-version}${application.formatted-version}" .getBytes()); String banner = printBanner(resource, null, null); - assertThat(banner, equalTo("banner 1\n")); + assertThat(banner, startsWith("banner 1\n")); } private String printBanner(Resource resource, String bootVersion,