Fix build failure

pull/6191/merge
Stephane Nicoll 9 years ago
parent f28e3d54c5
commit 97874a0749

@ -28,6 +28,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.AnnotationConfigurationException; import org.springframework.core.annotation.AnnotationConfigurationException;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.Matchers.containsString;
/** /**
* Tests for {@link TestEntityScan}. * Tests for {@link TestEntityScan}.
@ -77,9 +79,11 @@ public class TestEntityScanTests {
@Test @Test
public void valueAndBasePackagesThrows() throws Exception { public void valueAndBasePackagesThrows() throws Exception {
this.thrown.expect(AnnotationConfigurationException.class); this.thrown.expect(AnnotationConfigurationException.class);
this.thrown.expectMessage("attribute 'value' and its alias 'basePackages' are declared"); this.thrown.expectMessage(allOf(
this.thrown.expectMessage("com.mycorp.entity"); containsString("'value'"),
this.thrown.expectMessage("com.mycorp"); containsString("'basePackages'"),
containsString("com.mycorp.entity"),
containsString("com.mycorp")));
new AnnotationConfigApplicationContext(ValueAndBasePackages.class); new AnnotationConfigApplicationContext(ValueAndBasePackages.class);
} }

@ -26,6 +26,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.AnnotationConfigurationException; import org.springframework.core.annotation.AnnotationConfigurationException;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.Matchers.containsString;
/** /**
* Tests for {@link ServletComponentScanRegistrar} * Tests for {@link ServletComponentScanRegistrar}
@ -76,7 +78,11 @@ public class ServletComponentScanRegistrarTests {
@Test @Test
public void packagesConfiguredWithBothValueAndBasePackages() { public void packagesConfiguredWithBothValueAndBasePackages() {
this.thrown.expect(AnnotationConfigurationException.class); 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); new AnnotationConfigApplicationContext(ValueAndBasePackages.class);
} }

Loading…
Cancel
Save