From 97874a074928e92f4ca5bc0b7581338f64e9f40f Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 20 Jun 2016 14:40:57 +0200 Subject: [PATCH] Fix build failure --- .../boot/context/scan/TestEntityScanTests.java | 10 +++++++--- .../servlet/ServletComponentScanRegistrarTests.java | 8 +++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/spring-boot/src/test/java/org/springframework/boot/context/scan/TestEntityScanTests.java b/spring-boot/src/test/java/org/springframework/boot/context/scan/TestEntityScanTests.java index e25869fd96..d49e0df778 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/scan/TestEntityScanTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/scan/TestEntityScanTests.java @@ -28,6 +28,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AnnotationConfigurationException; import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.CoreMatchers.allOf; +import static org.hamcrest.Matchers.containsString; /** * Tests for {@link TestEntityScan}. @@ -77,9 +79,11 @@ public class TestEntityScanTests { @Test public void valueAndBasePackagesThrows() throws Exception { this.thrown.expect(AnnotationConfigurationException.class); - this.thrown.expectMessage("attribute 'value' and its alias 'basePackages' are declared"); - this.thrown.expectMessage("com.mycorp.entity"); - this.thrown.expectMessage("com.mycorp"); + this.thrown.expectMessage(allOf( + containsString("'value'"), + containsString("'basePackages'"), + containsString("com.mycorp.entity"), + containsString("com.mycorp"))); new AnnotationConfigApplicationContext(ValueAndBasePackages.class); } diff --git a/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrarTests.java b/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrarTests.java index 29c36c78cd..4c450f0289 100644 --- a/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrarTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletComponentScanRegistrarTests.java @@ -26,6 +26,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AnnotationConfigurationException; import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.CoreMatchers.allOf; +import static org.hamcrest.Matchers.containsString; /** * Tests for {@link ServletComponentScanRegistrar} @@ -76,7 +78,11 @@ public class ServletComponentScanRegistrarTests { @Test public void packagesConfiguredWithBothValueAndBasePackages() { this.thrown.expect(AnnotationConfigurationException.class); - this.thrown.expectMessage("attribute 'value' and its alias 'basePackages' are declared"); + this.thrown.expectMessage(allOf( + containsString("'value'"), + containsString("'basePackages'"), + containsString("com.example.foo"), + containsString("com.example.bar"))); new AnnotationConfigApplicationContext(ValueAndBasePackages.class); }