From a9c47df0c142f84cfafc2d7ab3dde4799b3889a4 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sat, 1 Nov 2014 14:05:32 +0100 Subject: [PATCH] Polishing --- .../handler/DestinationPatternsMessageCondition.java | 2 +- .../annotation/WebMvcConfigurationSupportTests.java | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/DestinationPatternsMessageCondition.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/DestinationPatternsMessageCondition.java index 919aa70e62..d738836fb6 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/DestinationPatternsMessageCondition.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/DestinationPatternsMessageCondition.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); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java index d9ed4a7fda..bc9afca609 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupportTests.java @@ -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 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 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 { }