From 5a3dd17d3023aa9014e8777e5f56d3d5ac2b1130 Mon Sep 17 00:00:00 2001 From: David Greven Date: Mon, 15 Nov 2021 16:11:57 +0100 Subject: [PATCH] ResultTest.swap hotfix (#19) Signed-off-by: David Greven Signed-off-by: Sebastian Becker --- .../test/java/io/carbynestack/common/result/ResultTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common-types/src/test/java/io/carbynestack/common/result/ResultTest.java b/common-types/src/test/java/io/carbynestack/common/result/ResultTest.java index 27f9869..dbe32b4 100644 --- a/common-types/src/test/java/io/carbynestack/common/result/ResultTest.java +++ b/common-types/src/test/java/io/carbynestack/common/result/ResultTest.java @@ -78,8 +78,8 @@ void result() { void swap() { var value = 12; var res = new Success(value); - assertThat(res.fold(r -> -1, identity())).isEqualTo(value); - assertThat(res.swap().fold(r -> -1, identity())).isEqualTo(-1); - assertThat(res.swap().swap().fold(r -> -1, identity())).isEqualTo(value); + assertThat(res.fold(identity(), r -> -1)).isEqualTo(value); + assertThat(res.swap().fold(identity(), r -> -1)).isEqualTo(-1); + assertThat(res.swap().swap().fold(identity(), r -> -1)).isEqualTo(value); } }