Consistent Class array vs vararg declarations (and related polishing)
(cherry picked from commit 3b810f3)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -76,7 +76,7 @@ public class SimpleMappingExceptionResolverTests {
|
||||
@Test
|
||||
public void defaultErrorViewDifferentHandlerClass() {
|
||||
exceptionResolver.setDefaultErrorView(DEFAULT_VIEW);
|
||||
exceptionResolver.setMappedHandlerClasses(new Class[] {String.class});
|
||||
exceptionResolver.setMappedHandlerClasses(String.class);
|
||||
ModelAndView mav = exceptionResolver.resolveException(request, response, handler2, genericException);
|
||||
assertNull("Handler not mapped - ModelAndView should be null", mav);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ public class SimpleMappingExceptionResolverTests {
|
||||
public void exactExceptionMappingWithHandlerClassSpecified() {
|
||||
Properties props = new Properties();
|
||||
props.setProperty("java.lang.Exception", "error");
|
||||
exceptionResolver.setMappedHandlerClasses(new Class[] {String.class});
|
||||
exceptionResolver.setMappedHandlerClasses(String.class);
|
||||
exceptionResolver.setExceptionMappings(props);
|
||||
ModelAndView mav = exceptionResolver.resolveException(request, response, handler1, genericException);
|
||||
assertEquals("error", mav.getViewName());
|
||||
@@ -156,7 +156,7 @@ public class SimpleMappingExceptionResolverTests {
|
||||
public void exactExceptionMappingWithHandlerInterfaceSpecified() {
|
||||
Properties props = new Properties();
|
||||
props.setProperty("java.lang.Exception", "error");
|
||||
exceptionResolver.setMappedHandlerClasses(new Class[] {Comparable.class});
|
||||
exceptionResolver.setMappedHandlerClasses(Comparable.class);
|
||||
exceptionResolver.setExceptionMappings(props);
|
||||
ModelAndView mav = exceptionResolver.resolveException(request, response, handler1, genericException);
|
||||
assertEquals("error", mav.getViewName());
|
||||
@@ -176,7 +176,7 @@ public class SimpleMappingExceptionResolverTests {
|
||||
public void simpleExceptionMappingWithHandlerSpecifiedButWrongHandlerClass() {
|
||||
Properties props = new Properties();
|
||||
props.setProperty("Exception", "error");
|
||||
exceptionResolver.setMappedHandlerClasses(new Class[] {String.class});
|
||||
exceptionResolver.setMappedHandlerClasses(String.class);
|
||||
exceptionResolver.setExceptionMappings(props);
|
||||
ModelAndView mav = exceptionResolver.resolveException(request, response, handler2, genericException);
|
||||
assertNull("Handler not mapped - ModelAndView should be null", mav);
|
||||
|
||||
Reference in New Issue
Block a user