Skip to content

Commit b16f021

Browse files
Update local_examples/cmds_hash/lettuce-async/CmdsHashExample.java
Co-authored-by: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com>
1 parent 04f111f commit b16f021

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

local_examples/cmds_hash/lettuce-async/CmdsHashExample.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,16 @@ public void run() {
214214
// REMOVE_END
215215
// Try to set expiration on non-existent field
216216
return asyncCommands.hexpire("myhash", 10, "nonexistent");
217-
}).thenAccept(res4 -> {
218-
System.out.println(res4);
219-
// >>> [-2]
220-
// REMOVE_START
221-
assertThat(res4).isEqualTo(Arrays.asList(-2L));
222-
// REMOVE_END
223-
}).toCompletableFuture();
217+
})
218+
// REMOVE_START
219+
.thenApply(res4 -> {
220+
assertThat(res4).isEqualTo(Arrays.asList(-2L));
221+
return res;
222+
})
223+
// REMOVE_END
224+
.thenAccept(System.out::println)
225+
// >>> -2
226+
.toCompletableFuture();
224227
// STEP_END
225228

226229
hExpireExample.join();

0 commit comments

Comments
 (0)