master
Juergen Hoeller 10 years ago
parent d1288fdb7c
commit a9c47df0c1
  1. 2
      spring-messaging/src/main/java/org/springframework/messaging/handler/DestinationPatternsMessageCondition.java
  2. 12
      spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java

@ -60,7 +60,7 @@ public class DestinationPatternsMessageCondition extends AbstractMessageConditio
/**
* Alternative constructor accepting a custom PathMatcher.
* @param patterns the URL patterns to use; if 0, the condition will match to every request.
* @param pathMatcher the PathMatcher to use.
* @param pathMatcher the PathMatcher to use
*/
public DestinationPatternsMessageCondition(String[] patterns, PathMatcher pathMatcher) {
this(asList(patterns), pathMatcher);

@ -93,7 +93,6 @@ import static org.junit.Assert.*;
*/
public class WebMvcConfigurationSupportTests {
@Test
public void requestMappingHandlerMapping() throws Exception {
ApplicationContext context = initContext(WebConfig.class, ScopedController.class, ScopedProxyController.class);
@ -208,10 +207,9 @@ public class WebMvcConfigurationSupportTests {
public void handlerExceptionResolver() throws Exception {
ApplicationContext context = initContext(WebConfig.class);
HandlerExceptionResolverComposite compositeResolver =
context.getBean("handlerExceptionResolver", HandlerExceptionResolverComposite.class);
context.getBean("handlerExceptionResolver", HandlerExceptionResolverComposite.class);
assertEquals(0, compositeResolver.getOrder());
List<HandlerExceptionResolver> expectedResolvers = compositeResolver.getExceptionResolvers();
assertEquals(ExceptionHandlerExceptionResolver.class, expectedResolvers.get(0).getClass());
@ -237,7 +235,6 @@ public class WebMvcConfigurationSupportTests {
finally {
LocaleContextHolder.resetLocaleContext();
}
}
@Test
@ -245,9 +242,6 @@ public class WebMvcConfigurationSupportTests {
ApplicationContext context = initContext(WebConfig.class);
ViewResolverComposite resolver = context.getBean("mvcViewResolver", ViewResolverComposite.class);
Map<String, ViewResolver> map = BeanFactoryUtils.beansOfTypeIncludingAncestors(
context, ViewResolver.class, true, false);
assertNotNull(resolver);
assertEquals(1, resolver.getViewResolvers().size());
assertEquals(InternalResourceViewResolver.class, resolver.getViewResolvers().get(0).getClass());
@ -317,6 +311,7 @@ public class WebMvcConfigurationSupportTests {
}
}
@Configuration
public static class ViewResolverConfig {
@ -326,6 +321,7 @@ public class WebMvcConfigurationSupportTests {
}
}
@EnableWebMvc
@Configuration
public static class CustomViewResolverOrderConfig extends WebMvcConfigurerAdapter {
@ -337,6 +333,7 @@ public class WebMvcConfigurationSupportTests {
}
}
@Controller
public static class TestController {
@ -371,6 +368,7 @@ public class WebMvcConfigurationSupportTests {
}
}
@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "exception.user.exists")
public static class UserAlreadyExistsException extends RuntimeException {
}

Loading…
Cancel
Save