You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vertx-web-session-stores/vertx-web-sstore-cookie/src/test/java/io/vertx/ext/web/sstore/cookie/tests/CookieSessionHandlerTest.java
+26-34Lines changed: 26 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -43,15 +43,13 @@ public void testGetSession() throws Exception {
43
43
Sessionsession = store.createSession(30_000);
44
44
StringcookieId = session.id();
45
45
46
-
store.get(session.value()).onComplete(get -> {
47
-
if (get.failed()) {
48
-
fail(get.cause());
49
-
} else {
50
-
assertNotNull(get.result());
51
-
assertEquals(cookieId, get.result().id());
46
+
store
47
+
.get(session.value())
48
+
.onComplete(onSuccess(c -> {
49
+
assertNotNull(c);
50
+
assertEquals(cookieId, c.id());
52
51
testComplete();
53
-
}
54
-
});
52
+
}));
55
53
56
54
await();
57
55
}
@@ -61,18 +59,16 @@ public void testParse() {
61
59
Sessionsession = store.createSession(30_000);
62
60
StringcookieValue = session.value();
63
61
64
-
store.get(cookieValue).onComplete(get -> {
65
-
if (get.failed()) {
66
-
fail(get.cause());
67
-
} else {
68
-
assertNotNull(get.result());
62
+
store
63
+
.get(cookieValue)
64
+
.onComplete(onSuccess(c -> {
65
+
assertNotNull(c);
69
66
// the session id must be the same
70
-
assertEquals(session.id(), get.result().id());
67
+
assertEquals(session.id(), c.id());
71
68
// the session value will not be the same as IV is random
0 commit comments