37
37
import org .springframework .context .annotation .Condition ;
38
38
import org .springframework .context .annotation .Import ;
39
39
40
- import static org .hamcrest .Matchers .containsInAnyOrder ;
40
+ import static org .hamcrest .Matchers .contains ;
41
41
import static org .hamcrest .Matchers .containsString ;
42
42
import static org .hamcrest .Matchers .equalTo ;
43
43
import static org .hamcrest .Matchers .not ;
@@ -201,7 +201,6 @@ public void testDuplicateConditionAndOutcomes() {
201
201
}
202
202
203
203
@ Test
204
- @ SuppressWarnings ("unchecked" )
205
204
public void duplicateOutcomes () {
206
205
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext (
207
206
DuplicateConfig .class );
@@ -212,7 +211,7 @@ public void duplicateOutcomes() {
212
211
ConditionAndOutcomes outcomes = report .getConditionAndOutcomesBySource ().get (
213
212
autoconfigKey );
214
213
assertThat (outcomes , not (nullValue ()));
215
- assertThat (getNumberOfOutcomes (outcomes ), equalTo (2 ));
214
+ assertThat (getNumberOfOutcomes (outcomes ), equalTo (1 ));
216
215
217
216
List <String > messages = new ArrayList <String >();
218
217
for (ConditionAndOutcome outcome : outcomes ) {
@@ -222,9 +221,7 @@ public void duplicateOutcomes() {
222
221
223
222
Matcher <String > onClassMessage = containsString ("@ConditionalOnClass "
224
223
+ "classes found: javax.servlet.Servlet,org.springframework.web.multipart.support.StandardServletMultipartResolver" );
225
- Matcher <String > onBeanMessage = containsString ("@ConditionalOnBean "
226
- + "(types: javax.servlet.MultipartConfigElement; SearchStrategy: all) found no beans" );
227
- assertThat (messages , containsInAnyOrder (onClassMessage , onBeanMessage ));
224
+ assertThat (messages , contains (onClassMessage ));
228
225
context .close ();
229
226
}
230
227
0 commit comments