aboutsummaryrefslogtreecommitdiffstats
path: root/jdisc_http_service/src/test
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@oath.com>2017-08-28 16:12:18 +0200
committerBjørn Christian Seime <bjorncs@oath.com>2017-09-01 11:00:56 +0200
commit057535ccddc091f54ea5484241373ea1ac00bdca (patch)
tree66ba5c881a9f5f51700bf4a6e7f9006b9d1c897e /jdisc_http_service/src/test
parent01cb53dc261de64ac396677a0a6ba1630c1f6cc4 (diff)
Remove Netty by replacing cookie codec with Jetty + Java SE
Diffstat (limited to 'jdisc_http_service/src/test')
-rw-r--r--jdisc_http_service/src/test/java/com/yahoo/jdisc/http/CookieTestCase.java7
-rw-r--r--jdisc_http_service/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java2
2 files changed, 6 insertions, 3 deletions
diff --git a/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/CookieTestCase.java b/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/CookieTestCase.java
index 0c98f294c82..ca12de72ec2 100644
--- a/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/CookieTestCase.java
+++ b/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/CookieTestCase.java
@@ -106,14 +106,14 @@ public class CookieTestCase {
"foo.name=foo.value",
Collections.singletonList(newCookie("foo")));
assertEncodeCookie(
- "foo.name=foo.value; bar.name=bar.value",
+ "foo.name=foo.value;bar.name=bar.value",
Arrays.asList(newCookie("foo"), newCookie("bar")));
}
@Test
public void requireThatSetCookieCanBeEncoded() {
assertEncodeSetCookie(
- Collections.singletonList("foo.name=foo.value; Path=path; Domain=domain; Secure; HTTPOnly"),
+ Collections.singletonList("foo.name=foo.value;Path=path;Domain=domain;Secure;HttpOnly"),
Collections.singletonList(newSetCookie("foo")));
}
@@ -131,6 +131,7 @@ public class CookieTestCase {
}
@Test
+ @SuppressWarnings("deprecation")
public void requireThatSetCookieCanBeDecoded() {
final Cookie foo = new Cookie();
foo.setName("foo.name");
@@ -140,6 +141,7 @@ public class CookieTestCase {
foo.setMaxAge(0, TimeUnit.SECONDS);
foo.setSecure(true);
foo.setHttpOnly(true);
+ foo.setVersion(1);
assertDecodeSetCookie(foo, "foo.name=foo.value;Max-Age=0;Path=path;Domain=domain;Secure;HTTPOnly;");
final Cookie bar = new Cookie();
@@ -148,6 +150,7 @@ public class CookieTestCase {
bar.setPath("path");
bar.setDomain("domain");
bar.setMaxAge(0, TimeUnit.SECONDS);
+ bar.setVersion(1);
assertDecodeSetCookie(bar, "bar.name=bar.value;Max-Age=0;Path=path;Domain=domain;");
}
diff --git a/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java b/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java
index 221a1adc1fe..7ed13decbf6 100644
--- a/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java
+++ b/jdisc_http_service/src/test/java/com/yahoo/jdisc/http/server/jetty/HttpServerTest.java
@@ -356,7 +356,7 @@ public class HttpServerTest {
driver.client().get("/status.html")
.expectStatusCode(is(OK))
.expectHeader("Set-Cookie",
- is("foo=bar; Path=/foopath; Domain=.localhost; Secure; HTTPOnly"));
+ is("foo=bar;Path=/foopath;Domain=.localhost;Secure;HttpOnly"));
assertThat(driver.close(), is(true));
}