File tree 2 files changed +48
-0
lines changed
spring-test/src/main/java/org/springframework/mock/web
spring-web/src/test/java/org/springframework/mock/web/test
2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,10 @@ public class MockServletContext implements ServletContext {
132
132
133
133
private int sessionTimeout ;
134
134
135
+ private String requestCharacterEncoding ;
136
+
137
+ private String responseCharacterEncoding ;
138
+
135
139
136
140
/**
137
141
* Create a new {@code MockServletContext}, using no base path and a
@@ -563,6 +567,26 @@ public int getSessionTimeout() {
563
567
return this .sessionTimeout ;
564
568
}
565
569
570
+ // @Override - but only against Servlet 4.0
571
+ public void setRequestCharacterEncoding (String requestCharacterEncoding ) {
572
+ this .requestCharacterEncoding = requestCharacterEncoding ;
573
+ }
574
+
575
+ // @Override - but only against Servlet 4.0
576
+ public String getRequestCharacterEncoding () {
577
+ return this .requestCharacterEncoding ;
578
+ }
579
+
580
+ // @Override - but only against Servlet 4.0
581
+ public void setResponseCharacterEncoding (String responseCharacterEncoding ) {
582
+ this .responseCharacterEncoding = responseCharacterEncoding ;
583
+ }
584
+
585
+ // @Override - but only against Servlet 4.0
586
+ public String getResponseCharacterEncoding () {
587
+ return this .responseCharacterEncoding ;
588
+ }
589
+
566
590
567
591
//---------------------------------------------------------------------
568
592
// Unsupported Servlet 3.0 registration methods
Original file line number Diff line number Diff line change @@ -132,6 +132,10 @@ public class MockServletContext implements ServletContext {
132
132
133
133
private int sessionTimeout ;
134
134
135
+ private String requestCharacterEncoding ;
136
+
137
+ private String responseCharacterEncoding ;
138
+
135
139
136
140
/**
137
141
* Create a new {@code MockServletContext}, using no base path and a
@@ -563,6 +567,26 @@ public int getSessionTimeout() {
563
567
return this .sessionTimeout ;
564
568
}
565
569
570
+ // @Override - but only against Servlet 4.0
571
+ public void setRequestCharacterEncoding (String requestCharacterEncoding ) {
572
+ this .requestCharacterEncoding = requestCharacterEncoding ;
573
+ }
574
+
575
+ // @Override - but only against Servlet 4.0
576
+ public String getRequestCharacterEncoding () {
577
+ return this .requestCharacterEncoding ;
578
+ }
579
+
580
+ // @Override - but only against Servlet 4.0
581
+ public void setResponseCharacterEncoding (String responseCharacterEncoding ) {
582
+ this .responseCharacterEncoding = responseCharacterEncoding ;
583
+ }
584
+
585
+ // @Override - but only against Servlet 4.0
586
+ public String getResponseCharacterEncoding () {
587
+ return this .responseCharacterEncoding ;
588
+ }
589
+
566
590
567
591
//---------------------------------------------------------------------
568
592
// Unsupported Servlet 3.0 registration methods
You can’t perform that action at this time.
0 commit comments