File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
org.springframework.test/src/main/java/org/springframework/mock/web Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package org .springframework .mock .web ;
18
18
19
+ import java .util .ArrayList ;
19
20
import java .util .Collection ;
20
21
import java .util .Collections ;
21
22
import java .util .LinkedList ;
@@ -58,6 +59,14 @@ public List<Object> getValues() {
58
59
return Collections .unmodifiableList (this .values );
59
60
}
60
61
62
+ public List <String > getStringValues () {
63
+ List <String > stringList = new ArrayList <String >(this .values .size ());
64
+ for (Object value : this .values ) {
65
+ stringList .add (value .toString ());
66
+ }
67
+ return Collections .unmodifiableList (stringList );
68
+ }
69
+
61
70
public Object getValue () {
62
71
return (!this .values .isEmpty () ? this .values .get (0 ) : null );
63
72
}
Original file line number Diff line number Diff line change @@ -678,9 +678,9 @@ public String getHeader(String name) {
678
678
return (header != null ? header .getValue ().toString () : null );
679
679
}
680
680
681
- public Enumeration <Object > getHeaders (String name ) {
681
+ public Enumeration <String > getHeaders (String name ) {
682
682
HeaderValueHolder header = HeaderValueHolder .getByName (this .headers , name );
683
- return Collections .enumeration (header != null ? header .getValues () : Collections . emptyList ());
683
+ return Collections .enumeration (header != null ? header .getStringValues () : new LinkedList < String > ());
684
684
}
685
685
686
686
public Enumeration <String > getHeaderNames () {
Original file line number Diff line number Diff line change @@ -307,7 +307,7 @@ public Object getHeader(String name) {
307
307
* @param name the name of the header
308
308
* @return the associated header values, or an empty List if none
309
309
*/
310
- public List getHeaders (String name ) {
310
+ public List < Object > getHeaders (String name ) {
311
311
HeaderValueHolder header = HeaderValueHolder .getByName (this .headers , name );
312
312
return (header != null ? header .getValues () : Collections .emptyList ());
313
313
}
You can’t perform that action at this time.
0 commit comments