Full alignment of spring-test vs spring-web MockCookie variants

Issue: SPR-17321
This commit is contained in:
Juergen Hoeller
2018-10-09 23:13:18 +02:00
parent cf3635b42d
commit efdbddd358
2 changed files with 25 additions and 21 deletions

View File

@@ -81,7 +81,8 @@ public class MockCookie extends Cookie {
String name = cookieParts[0];
String[] valueAndAttributes = cookieParts[1].split("\\s*;\\s*", 2);
String value = valueAndAttributes[0];
String[] attributes = valueAndAttributes.length > 1 ? valueAndAttributes[1].split("\\s*;\\s*") : new String[0];
String[] attributes =
(valueAndAttributes.length > 1 ? valueAndAttributes[1].split("\\s*;\\s*") : new String[0]);
MockCookie cookie = new MockCookie(name, value);
for (String attribute : attributes) {