|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2002-2019 the original author or authors. |
|
|
|
|
* Copyright 2002-2020 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. |
|
|
|
|
@ -16,6 +16,7 @@
@@ -16,6 +16,7 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.web.filter; |
|
|
|
|
|
|
|
|
|
import javax.servlet.DispatcherType; |
|
|
|
|
import javax.servlet.FilterChain; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
@ -51,6 +52,7 @@ public class CharacterEncodingFilterTests {
@@ -51,6 +52,7 @@ public class CharacterEncodingFilterTests {
|
|
|
|
|
request.setCharacterEncoding(ENCODING); |
|
|
|
|
given(request.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE)).willReturn(null); |
|
|
|
|
given(request.getAttribute(filteredName(FILTER_NAME))).willReturn(null); |
|
|
|
|
given(request.getDispatcherType()).willReturn(DispatcherType.REQUEST); |
|
|
|
|
|
|
|
|
|
HttpServletResponse response = mock(HttpServletResponse.class); |
|
|
|
|
FilterChain filterChain = mock(FilterChain.class); |
|
|
|
|
@ -71,6 +73,7 @@ public class CharacterEncodingFilterTests {
@@ -71,6 +73,7 @@ public class CharacterEncodingFilterTests {
|
|
|
|
|
given(request.getCharacterEncoding()).willReturn(null); |
|
|
|
|
given(request.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE)).willReturn(null); |
|
|
|
|
given(request.getAttribute(filteredName(FILTER_NAME))).willReturn(null); |
|
|
|
|
given(request.getDispatcherType()).willReturn(DispatcherType.REQUEST); |
|
|
|
|
|
|
|
|
|
MockHttpServletResponse response = new MockHttpServletResponse(); |
|
|
|
|
|
|
|
|
|
@ -92,6 +95,7 @@ public class CharacterEncodingFilterTests {
@@ -92,6 +95,7 @@ public class CharacterEncodingFilterTests {
|
|
|
|
|
given(request.getCharacterEncoding()).willReturn(ENCODING); |
|
|
|
|
given(request.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE)).willReturn(null); |
|
|
|
|
given(request.getAttribute(filteredName(FILTER_NAME))).willReturn(null); |
|
|
|
|
given(request.getDispatcherType()).willReturn(DispatcherType.REQUEST); |
|
|
|
|
|
|
|
|
|
MockHttpServletResponse response = new MockHttpServletResponse(); |
|
|
|
|
|
|
|
|
|
@ -112,6 +116,7 @@ public class CharacterEncodingFilterTests {
@@ -112,6 +116,7 @@ public class CharacterEncodingFilterTests {
|
|
|
|
|
given(request.getCharacterEncoding()).willReturn(null); |
|
|
|
|
given(request.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE)).willReturn(null); |
|
|
|
|
given(request.getAttribute(filteredName(FILTER_NAME))).willReturn(null); |
|
|
|
|
given(request.getDispatcherType()).willReturn(DispatcherType.REQUEST); |
|
|
|
|
|
|
|
|
|
MockHttpServletResponse response = new MockHttpServletResponse(); |
|
|
|
|
|
|
|
|
|
@ -135,6 +140,7 @@ public class CharacterEncodingFilterTests {
@@ -135,6 +140,7 @@ public class CharacterEncodingFilterTests {
|
|
|
|
|
given(request.getCharacterEncoding()).willReturn(null); |
|
|
|
|
given(request.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE)).willReturn(null); |
|
|
|
|
given(request.getAttribute(filteredName(CharacterEncodingFilter.class.getName()))).willReturn(null); |
|
|
|
|
given(request.getDispatcherType()).willReturn(DispatcherType.REQUEST); |
|
|
|
|
|
|
|
|
|
MockHttpServletResponse response = new MockHttpServletResponse(); |
|
|
|
|
|
|
|
|
|
@ -156,6 +162,7 @@ public class CharacterEncodingFilterTests {
@@ -156,6 +162,7 @@ public class CharacterEncodingFilterTests {
|
|
|
|
|
request.setCharacterEncoding(ENCODING); |
|
|
|
|
given(request.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE)).willReturn(null); |
|
|
|
|
given(request.getAttribute(filteredName(FILTER_NAME))).willReturn(null); |
|
|
|
|
given(request.getDispatcherType()).willReturn(DispatcherType.REQUEST); |
|
|
|
|
|
|
|
|
|
HttpServletResponse response = mock(HttpServletResponse.class); |
|
|
|
|
FilterChain filterChain = mock(FilterChain.class); |
|
|
|
|
|