Polishing
This commit is contained in:
parent
d1288fdb7c
commit
a9c47df0c1
|
@ -60,7 +60,7 @@ public class DestinationPatternsMessageCondition extends AbstractMessageConditio
|
||||||
/**
|
/**
|
||||||
* Alternative constructor accepting a custom PathMatcher.
|
* Alternative constructor accepting a custom PathMatcher.
|
||||||
* @param patterns the URL patterns to use; if 0, the condition will match to every request.
|
* @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) {
|
public DestinationPatternsMessageCondition(String[] patterns, PathMatcher pathMatcher) {
|
||||||
this(asList(patterns), pathMatcher);
|
this(asList(patterns), pathMatcher);
|
||||||
|
|
|
@ -93,7 +93,6 @@ import static org.junit.Assert.*;
|
||||||
*/
|
*/
|
||||||
public class WebMvcConfigurationSupportTests {
|
public class WebMvcConfigurationSupportTests {
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void requestMappingHandlerMapping() throws Exception {
|
public void requestMappingHandlerMapping() throws Exception {
|
||||||
ApplicationContext context = initContext(WebConfig.class, ScopedController.class, ScopedProxyController.class);
|
ApplicationContext context = initContext(WebConfig.class, ScopedController.class, ScopedProxyController.class);
|
||||||
|
@ -211,7 +210,6 @@ public class WebMvcConfigurationSupportTests {
|
||||||
context.getBean("handlerExceptionResolver", HandlerExceptionResolverComposite.class);
|
context.getBean("handlerExceptionResolver", HandlerExceptionResolverComposite.class);
|
||||||
|
|
||||||
assertEquals(0, compositeResolver.getOrder());
|
assertEquals(0, compositeResolver.getOrder());
|
||||||
|
|
||||||
List<HandlerExceptionResolver> expectedResolvers = compositeResolver.getExceptionResolvers();
|
List<HandlerExceptionResolver> expectedResolvers = compositeResolver.getExceptionResolvers();
|
||||||
|
|
||||||
assertEquals(ExceptionHandlerExceptionResolver.class, expectedResolvers.get(0).getClass());
|
assertEquals(ExceptionHandlerExceptionResolver.class, expectedResolvers.get(0).getClass());
|
||||||
|
@ -237,7 +235,6 @@ public class WebMvcConfigurationSupportTests {
|
||||||
finally {
|
finally {
|
||||||
LocaleContextHolder.resetLocaleContext();
|
LocaleContextHolder.resetLocaleContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -245,9 +242,6 @@ public class WebMvcConfigurationSupportTests {
|
||||||
ApplicationContext context = initContext(WebConfig.class);
|
ApplicationContext context = initContext(WebConfig.class);
|
||||||
ViewResolverComposite resolver = context.getBean("mvcViewResolver", ViewResolverComposite.class);
|
ViewResolverComposite resolver = context.getBean("mvcViewResolver", ViewResolverComposite.class);
|
||||||
|
|
||||||
Map<String, ViewResolver> map = BeanFactoryUtils.beansOfTypeIncludingAncestors(
|
|
||||||
context, ViewResolver.class, true, false);
|
|
||||||
|
|
||||||
assertNotNull(resolver);
|
assertNotNull(resolver);
|
||||||
assertEquals(1, resolver.getViewResolvers().size());
|
assertEquals(1, resolver.getViewResolvers().size());
|
||||||
assertEquals(InternalResourceViewResolver.class, resolver.getViewResolvers().get(0).getClass());
|
assertEquals(InternalResourceViewResolver.class, resolver.getViewResolvers().get(0).getClass());
|
||||||
|
@ -317,6 +311,7 @@ public class WebMvcConfigurationSupportTests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public static class ViewResolverConfig {
|
public static class ViewResolverConfig {
|
||||||
|
|
||||||
|
@ -326,6 +321,7 @@ public class WebMvcConfigurationSupportTests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EnableWebMvc
|
@EnableWebMvc
|
||||||
@Configuration
|
@Configuration
|
||||||
public static class CustomViewResolverOrderConfig extends WebMvcConfigurerAdapter {
|
public static class CustomViewResolverOrderConfig extends WebMvcConfigurerAdapter {
|
||||||
|
@ -337,6 +333,7 @@ public class WebMvcConfigurationSupportTests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public static class TestController {
|
public static class TestController {
|
||||||
|
|
||||||
|
@ -371,6 +368,7 @@ public class WebMvcConfigurationSupportTests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "exception.user.exists")
|
@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "exception.user.exists")
|
||||||
public static class UserAlreadyExistsException extends RuntimeException {
|
public static class UserAlreadyExistsException extends RuntimeException {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue