Polishing

(cherry picked from commit 6aa5931)
This commit is contained in:
Juergen Hoeller
2016-07-07 01:05:25 +02:00
parent 942ead75e2
commit e30429051d
8 changed files with 53 additions and 59 deletions
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.servlet.mvc.method.annotation;
import java.lang.reflect.Method;
@@ -40,14 +41,8 @@ import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.BDDMockito.given;
import static org.junit.Assert.*;
import static org.mockito.BDDMockito.*;
import static org.mockito.Mockito.mock;
/**
@@ -87,7 +82,7 @@ public abstract class AbstractRequestAttributesArgumentResolverTests {
@Test
public void supportsParameter() throws Exception {
assertTrue(this.resolver.supportsParameter(new MethodParameter(this.handleMethod, 0)));
assertFalse(this.resolver.supportsParameter(new MethodParameter(this.handleMethod, 4)));
assertFalse(this.resolver.supportsParameter(new MethodParameter(this.handleMethod, -1)));
}
@Test
@@ -180,6 +175,8 @@ public abstract class AbstractRequestAttributesArgumentResolverTests {
@SessionAttribute(name="foo") Optional<Foo> optionalFoo) {
}
private static class Foo {
}
}
@@ -13,19 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.servlet.mvc.method.annotation;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
/**
* Unit tests for {@link RequestAttributeMethodArgumentResolver}.
*
* @author Rossen Stoyanchev
* @since 4.3
*/
public class RequestAttributeMethodArgumentResolverTests
extends AbstractRequestAttributesArgumentResolverTests {
public class RequestAttributeMethodArgumentResolverTests extends AbstractRequestAttributesArgumentResolverTests {
@Override
protected HandlerMethodArgumentResolver createResolver() {
@@ -13,19 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.servlet.mvc.method.annotation;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
/**
* Unit tests for {@link SessionAttributeMethodArgumentResolver}.
*
* @author Rossen Stoyanchev
* @since 4.3
*/
public class SessionAttributeMethodArgumentResolverTests
extends AbstractRequestAttributesArgumentResolverTests {
public class SessionAttributeMethodArgumentResolverTests extends AbstractRequestAttributesArgumentResolverTests {
@Override
protected HandlerMethodArgumentResolver createResolver() {