public class TestModuleTest {
@Test
public void test(TestHarness harn) throws Throwable {
assertTrue(true);
CookieStore store = new CookieStore();
CallResult res = harn.get("/ok").setCookieStore(store).go().assertStatus(OK);
res.assertHasHeader(Headers.SET_COOKIE.name());
assertTrue(store.iterator().hasNext());
res.assertCookieValue("xid", "1").throwIfError();
res = harn.get("/ok").setCookieStore(store).go().assertStatus(OK);
res.assertCookieValue("xid", "2");
res.throwIfError();
assertEquals(store + " " + store.size(), 1, store.size());
Iterator<Cookie> iter = store.iterator();
assertTrue(store + "", iter.hasNext());
iter.next();
assertFalse(store + "", iter.hasNext());
res = harn.get("/cookie").setCookieStore(store).addQueryPair("key", "foo")
.addQueryPair("value", "bar").go()
.assertStatus(OK)
.assertCookieValue("foo", "bar");
res = harn.get("/cookie").setCookieStore(store).addQueryPair("key", "wump")
.addQueryPair("value", "baz").go()
.assertStatus(OK)
.assertCookieValue("wump", "baz");
assertEquals(store + "", "baz", store.get("wump"));
assertEquals(store + "", "bar", store.get("foo"));
}