Commit d597cc33 authored by Dave Syer's avatar Dave Syer

Fix test broken in gh-708

parent 6ad7257b
...@@ -37,7 +37,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext ...@@ -37,7 +37,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.not;
...@@ -201,7 +201,6 @@ public class AutoConfigurationReportTests { ...@@ -201,7 +201,6 @@ public class AutoConfigurationReportTests {
} }
@Test @Test
@SuppressWarnings("unchecked")
public void duplicateOutcomes() { public void duplicateOutcomes() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
DuplicateConfig.class); DuplicateConfig.class);
...@@ -212,7 +211,7 @@ public class AutoConfigurationReportTests { ...@@ -212,7 +211,7 @@ public class AutoConfigurationReportTests {
ConditionAndOutcomes outcomes = report.getConditionAndOutcomesBySource().get( ConditionAndOutcomes outcomes = report.getConditionAndOutcomesBySource().get(
autoconfigKey); autoconfigKey);
assertThat(outcomes, not(nullValue())); assertThat(outcomes, not(nullValue()));
assertThat(getNumberOfOutcomes(outcomes), equalTo(2)); assertThat(getNumberOfOutcomes(outcomes), equalTo(1));
List<String> messages = new ArrayList<String>(); List<String> messages = new ArrayList<String>();
for (ConditionAndOutcome outcome : outcomes) { for (ConditionAndOutcome outcome : outcomes) {
...@@ -222,9 +221,7 @@ public class AutoConfigurationReportTests { ...@@ -222,9 +221,7 @@ public class AutoConfigurationReportTests {
Matcher<String> onClassMessage = containsString("@ConditionalOnClass " Matcher<String> onClassMessage = containsString("@ConditionalOnClass "
+ "classes found: javax.servlet.Servlet,org.springframework.web.multipart.support.StandardServletMultipartResolver"); + "classes found: javax.servlet.Servlet,org.springframework.web.multipart.support.StandardServletMultipartResolver");
Matcher<String> onBeanMessage = containsString("@ConditionalOnBean " assertThat(messages, contains(onClassMessage));
+ "(types: javax.servlet.MultipartConfigElement; SearchStrategy: all) found no beans");
assertThat(messages, containsInAnyOrder(onClassMessage, onBeanMessage));
context.close(); context.close();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment