From a9beeacf0b4b56e618f250e11d818404f2477a31 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Mon, 9 Jul 2018 15:24:28 +0100 Subject: [PATCH] Update ResultTest sample businessOperation --- src/test/java/net/kemitix/mon/ResultTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/java/net/kemitix/mon/ResultTest.java b/src/test/java/net/kemitix/mon/ResultTest.java index 920ba02..0a61897 100644 --- a/src/test/java/net/kemitix/mon/ResultTest.java +++ b/src/test/java/net/kemitix/mon/ResultTest.java @@ -626,10 +626,11 @@ public class ResultTest implements WithAssertions { } Result businessOperation(final String fileName1, final String fileName2) { - return readIntFromFile(fileName1).flatMap(intFromFile1 -> - adjustValue(intFromFile1).flatMap(adjustedIntFromFile1 -> - readIntFromFile(fileName2).flatMap(intFromFile2 -> - calculateAverage(adjustedIntFromFile1, intFromFile2)))); + return readIntFromFile(fileName1) + .andThen(intFromFile1 -> () -> adjustValue(intFromFile1)) + .flatMap(adjustedIntFromFile1 -> readIntFromFile(fileName2) + .flatMap(intFromFile2 -> adjustedIntFromFile1 + .flatMap(aif1 -> calculateAverage(aif1, intFromFile2)))); } private Result readIntFromFile(final String fileName) {