|
|
|
|
@ -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.Import; |
|
|
|
|
|
|
|
|
|
import static org.hamcrest.Matchers.containsInAnyOrder; |
|
|
|
|
import static org.hamcrest.Matchers.contains; |
|
|
|
|
import static org.hamcrest.Matchers.containsString; |
|
|
|
|
import static org.hamcrest.Matchers.equalTo; |
|
|
|
|
import static org.hamcrest.Matchers.not; |
|
|
|
|
@ -201,7 +201,6 @@ public class AutoConfigurationReportTests {
@@ -201,7 +201,6 @@ public class AutoConfigurationReportTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
|
public void duplicateOutcomes() { |
|
|
|
|
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( |
|
|
|
|
DuplicateConfig.class); |
|
|
|
|
@ -212,7 +211,7 @@ public class AutoConfigurationReportTests {
@@ -212,7 +211,7 @@ public class AutoConfigurationReportTests {
|
|
|
|
|
ConditionAndOutcomes outcomes = report.getConditionAndOutcomesBySource().get( |
|
|
|
|
autoconfigKey); |
|
|
|
|
assertThat(outcomes, not(nullValue())); |
|
|
|
|
assertThat(getNumberOfOutcomes(outcomes), equalTo(2)); |
|
|
|
|
assertThat(getNumberOfOutcomes(outcomes), equalTo(1)); |
|
|
|
|
|
|
|
|
|
List<String> messages = new ArrayList<String>(); |
|
|
|
|
for (ConditionAndOutcome outcome : outcomes) { |
|
|
|
|
@ -222,9 +221,7 @@ public class AutoConfigurationReportTests {
@@ -222,9 +221,7 @@ public class AutoConfigurationReportTests {
|
|
|
|
|
|
|
|
|
|
Matcher<String> onClassMessage = containsString("@ConditionalOnClass " |
|
|
|
|
+ "classes found: javax.servlet.Servlet,org.springframework.web.multipart.support.StandardServletMultipartResolver"); |
|
|
|
|
Matcher<String> onBeanMessage = containsString("@ConditionalOnBean " |
|
|
|
|
+ "(types: javax.servlet.MultipartConfigElement; SearchStrategy: all) found no beans"); |
|
|
|
|
assertThat(messages, containsInAnyOrder(onClassMessage, onBeanMessage)); |
|
|
|
|
assertThat(messages, contains(onClassMessage)); |
|
|
|
|
context.close(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|