public class Approvals
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
verify(java.lang.Object output)
Compares the actual output of your program (the function’s argument) and the content of the approved file matching with the test method.
|
static <I1> void |
verifyAllCombinations(I1[] args1,
Function1<I1,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
verify(Object) for details). |
static <I1,I2> void |
verifyAllCombinations(I1[] args1,
I2[] args2,
Function2<I1,I2,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
verify(Object) for details). |
static <I1,I2,I3> void |
verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
Function3<I1,I2,I3,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
verify(Object) for details). |
static <I1,I2,I3,I4> |
verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
I4[] args4,
Function4<I1,I2,I3,I4,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
verify(Object) for details). |
static <I1,I2,I3,I4,I5> |
verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
I4[] args4,
I5[] args5,
Function5<I1,I2,I3,I4,I5,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
verify(Object) for details). |
static <I1> void |
verifyAllCombinations(java.lang.Iterable<I1> args1,
Function1<I1,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
verify(Object) for details). |
static <I1,I2> void |
verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
Function2<I1,I2,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
verify(Object) for details). |
static <I1,I2,I3> void |
verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
Function3<I1,I2,I3,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
verify(Object) for details). |
static <I1,I2,I3,I4> |
verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
java.lang.Iterable<I4> args4,
Function4<I1,I2,I3,I4,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
verify(Object) for details). |
static <I1,I2,I3,I4,I5> |
verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
java.lang.Iterable<I4> args4,
java.lang.Iterable<I5> args5,
Function5<I1,I2,I3,I4,I5,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see
verify(Object) for details). |
static void |
verifyAllFiles(java.nio.file.Path actualFolder)
Compares the actual output of your program (files in the folder
actualFolder) and the content of the approved “Master” folder matching with the test method. |
public static void verify(java.lang.Object output)
Compares the actual output of your program (the function’s argument) and the content of the approved file matching with the test method.
It’ll use a temporary received file to store the output of your program. This file will be erased in case the results are matching. Otherwise, it will be kept for you to review it.
In case of differences found in the output, the Reporter linked to this Approvals instance will be called (Reporter.mismatch(Path, Path)).
output - Any object with a Object.toString() representation containing the output of your program. It will be compared to the associated approved file.java.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static void verifyAllFiles(java.nio.file.Path actualFolder)
Compares the actual output of your program (files in the folder actualFolder) and the content of the approved “Master” folder matching with the test method.
It’ll use a temporary received folder to copy the actual files from your program. This folder and its files will be erased in case the results are matching. Otherwise, they will be kept for you to review it.
In case of differences found in the output, the Reporter linked to this Approvals instance will be called (Reporter.mismatch(Path, Path)) for each mismatched file.
actualFolder - the folder containing the output of your program. It will be compared to the associated approved folderjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static <I1> void verifyAllCombinations(java.lang.Iterable<I1> args1,
Function1<I1,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see verify(Object) for details).
The lambda or method f is called for all values of args1 specified in the Iterable. Then the results are stored, one line for each value, in a String, which is used as in the standard verify(Object) method.
args1 - all values for the argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static <I1> void verifyAllCombinations(I1[] args1,
Function1<I1,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see verify(Object) for details).
The lambda or method f is called for all values of args1 specified in the array. Then the results are stored, one line for each value, in a String, which is used as in the standard verify(Object) method.
args1 - all values for the argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static <I1,I2> void verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
Function2<I1,I2,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see verify(Object) for details).
The lambda or method f is called for all values of args1 and args2 specified in the Iterables. Then the results are stored, one line for each combination, in a String, which is used as in the standard verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static <I1,I2> void verifyAllCombinations(I1[] args1,
I2[] args2,
Function2<I1,I2,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see verify(Object) for details).
The lambda or method f is called for all values of args1 and args2 specified in the arrayss. Then the results are stored, one line for each combination, in a String, which is used as in the standard verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static <I1,I2,I3> void verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
Function3<I1,I2,I3,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see verify(Object) for details).
The lambda or method f is called for all values of args1, args2 and args3 specified in the Iterables. Then the results are stored, one line for each combination, in a String, which is used as in the standard verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static <I1,I2,I3> void verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
Function3<I1,I2,I3,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see verify(Object) for details).
The lambda or method f is called for all values of args1, args2 and args3 specified in the arrays. Then the results are stored, one line for each combination, in a String, which is used as in the standard verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static <I1,I2,I3,I4> void verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
java.lang.Iterable<I4> args4,
Function4<I1,I2,I3,I4,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see verify(Object) for details).
The lambda or method f is called for all values of args1, args2, args3 and args4 specified in the Iterables. Then the results are stored, one line for each combination, in a String, which is used as in the standard verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyargs4 - all values for the fourth argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static <I1,I2,I3,I4> void verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
I4[] args4,
Function4<I1,I2,I3,I4,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see verify(Object) for details).
The lambda or method f is called for all values of args1, args2, args3 and args4 specified in the arrays. Then the results are stored, one line for each combination, in a String, which is used as in the standard verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyargs4 - all values for the fourth argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static <I1,I2,I3,I4,I5> void verifyAllCombinations(java.lang.Iterable<I1> args1,
java.lang.Iterable<I2> args2,
java.lang.Iterable<I3> args3,
java.lang.Iterable<I4> args4,
java.lang.Iterable<I5> args5,
Function5<I1,I2,I3,I4,I5,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see verify(Object) for details).
The lambda or method f is called for all values of args1, args2, args3, args4 and args5 specified in the Iterables. Then the results are stored, one line for each combination, in a String, which is used as in the standard verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyargs4 - all values for the fourth argument of f you want to verifyargs5 - all values for the fifth argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedpublic static <I1,I2,I3,I4,I5> void verifyAllCombinations(I1[] args1,
I2[] args2,
I3[] args3,
I4[] args4,
I5[] args5,
Function5<I1,I2,I3,I4,I5,?> f)
Compares the actual output of your program and the content of the approved file matching with the test method (see verify(Object) for details).
The lambda or method f is called for all values of args1, args2, args3, args4 and args5 specified in the arrays. Then the results are stored, one line for each combination, in a String, which is used as in the standard verify(Object) method.
args1 - all values for the first argument of f you want to verifyargs2 - all values for the second argument of f you want to verifyargs3 - all values for the third argument of f you want to verifyargs4 - all values for the fourth argument of f you want to verifyargs5 - all values for the fifth argument of f you want to verifyf - the lambda or method you want to testjava.lang.AssertionError - if the Reporter implementation relies on standard assertions provided by a framework like JUnitjava.lang.RuntimeException - if the Reporter relies on executing an external command which failedCopyright © 2018 Write Them First!. All rights reserved.