From b96b0481682ada434cd11095f1debcedfc5863ea Mon Sep 17 00:00:00 2001 From: powercomsmt Date: Fri, 12 Nov 2021 01:11:24 +0800 Subject: [PATCH] Add some test codes for a resolved issue [WW-5100] --- .../java/org/apache/struts2/dispatcher/DispatcherTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java b/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java index a882c28b9..b71c94b37 100644 --- a/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java +++ b/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java @@ -81,6 +81,7 @@ public class DispatcherTest extends StrutsInternalTestCase { du.prepare(req, res); assertEquals(req.getCharacterEncoding(), "utf-8"); + assertEquals(res.getCharacterEncoding(), "utf-8"); } public void testEncodingForXMLHttpRequest() throws Exception { @@ -99,6 +100,7 @@ public class DispatcherTest extends StrutsInternalTestCase { // then assertEquals(req.getCharacterEncoding(), "UTF-8"); + assertEquals(res.getCharacterEncoding(), "UTF-8"); } public void testSetEncodingIfDiffer() throws Exception { @@ -121,6 +123,7 @@ public class DispatcherTest extends StrutsInternalTestCase { // then assertEquals(req.getCharacterEncoding(), "utf-8"); + assertEquals(res.getCharacterEncoding(), "utf-8"); mock.verify(); } @@ -135,6 +138,7 @@ public class DispatcherTest extends StrutsInternalTestCase { du.prepare(req, res); assertEquals("utf-8", req.getCharacterEncoding()); + assertEquals("utf-8", res.getCharacterEncoding()); } public void testPrepareMultipartRequest() throws Exception {