aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/test/java/com/yahoo/jdisc/http/filter/JDiscCookieWrapperTest.java
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2021-03-25 01:21:57 +0100
committerGitHub <noreply@github.com>2021-03-25 01:21:57 +0100
commitb8efc4785db0d3fef303b22e30e6f23e85ea4e51 (patch)
treec78641c028428abb907baf03fac6eb163873d38a /container-core/src/test/java/com/yahoo/jdisc/http/filter/JDiscCookieWrapperTest.java
parent17978ed4bc296f2bd27e00b35244a6b1da66f40d (diff)
parent0176ecaec7b8beecacc0c27597b5f92d7db520f4 (diff)
Merge pull request #17140 from vespa-engine/gjoranv/merge-http-into-core_rebased
Gjoranv/merge http into core (rebased)
Diffstat (limited to 'container-core/src/test/java/com/yahoo/jdisc/http/filter/JDiscCookieWrapperTest.java')
-rw-r--r--container-core/src/test/java/com/yahoo/jdisc/http/filter/JDiscCookieWrapperTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/container-core/src/test/java/com/yahoo/jdisc/http/filter/JDiscCookieWrapperTest.java b/container-core/src/test/java/com/yahoo/jdisc/http/filter/JDiscCookieWrapperTest.java
new file mode 100644
index 00000000000..9948e5bfe7f
--- /dev/null
+++ b/container-core/src/test/java/com/yahoo/jdisc/http/filter/JDiscCookieWrapperTest.java
@@ -0,0 +1,29 @@
+// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.jdisc.http.filter;
+
+import com.yahoo.jdisc.http.Cookie;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.concurrent.TimeUnit;
+
+public class JDiscCookieWrapperTest {
+
+ @Test
+ public void requireThatWrapWorks() {
+ Cookie cookie = new Cookie("name", "value");
+ JDiscCookieWrapper wrapper = JDiscCookieWrapper.wrap(cookie);
+
+ wrapper.setDomain("yahoo.com");
+ wrapper.setMaxAge(10);
+ wrapper.setPath("/path");
+
+ Assert.assertEquals(wrapper.getName(), cookie.getName());
+ Assert.assertEquals(wrapper.getValue(), cookie.getValue());
+ Assert.assertEquals(wrapper.getDomain(), cookie.getDomain());
+ Assert.assertEquals(wrapper.getMaxAge(), cookie.getMaxAge(TimeUnit.SECONDS));
+ Assert.assertEquals(wrapper.getPath(), cookie.getPath());
+ Assert.assertEquals(wrapper.getSecure(), cookie.isSecure());
+
+ }
+}