Update ResultTest sample businessOperation
This commit is contained in:
parent
f6eb27450f
commit
a9beeacf0b
1 changed files with 5 additions and 4 deletions
|
@ -626,10 +626,11 @@ public class ResultTest implements WithAssertions {
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<Double> businessOperation(final String fileName1, final String fileName2) {
|
Result<Double> businessOperation(final String fileName1, final String fileName2) {
|
||||||
return readIntFromFile(fileName1).flatMap(intFromFile1 ->
|
return readIntFromFile(fileName1)
|
||||||
adjustValue(intFromFile1).flatMap(adjustedIntFromFile1 ->
|
.andThen(intFromFile1 -> () -> adjustValue(intFromFile1))
|
||||||
readIntFromFile(fileName2).flatMap(intFromFile2 ->
|
.flatMap(adjustedIntFromFile1 -> readIntFromFile(fileName2)
|
||||||
calculateAverage(adjustedIntFromFile1, intFromFile2))));
|
.flatMap(intFromFile2 -> adjustedIntFromFile1
|
||||||
|
.flatMap(aif1 -> calculateAverage(aif1, intFromFile2))));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Result<Integer> readIntFromFile(final String fileName) {
|
private Result<Integer> readIntFromFile(final String fileName) {
|
||||||
|
|
Loading…
Reference in a new issue