1
1
package org .approvaltests .integrations .junit5 ;
2
2
3
+ import com .spun .util .logger .SimpleLogger ;
3
4
import org .approvaltests .SafetyCheckBeforeVerify ;
4
5
import org .approvaltests .Approvals ;
5
6
import org .approvaltests .core .Experimental ;
6
7
import org .approvaltests .core .Options ;
8
+ import org .junit .jupiter .api .DisplayNameGenerator ;
7
9
import org .junit .jupiter .api .DynamicTest ;
8
10
import org .lambda .actions .Action1 ;
9
11
@@ -20,9 +22,13 @@ public static DynamicTest dynamicTest(String displayName, Action1<Options> actio
20
22
}
21
23
private static void checkOptionsWasUsed (Options actual , Options expected )
22
24
{
23
- if (!actual .forFile ().getNamer ().getAdditionalInformation ()
24
- .startsWith (expected .forFile ().getNamer ().getAdditionalInformation ()))
25
+ String actualAdditionalInformation = actual .forFile ().getNamer ().getAdditionalInformation ();
26
+ String expectedAdditionalInformation = expected .forFile ().getNamer ().getAdditionalInformation ();
27
+ if (!actualAdditionalInformation
28
+ .startsWith (expectedAdditionalInformation ))
25
29
{
30
+ SimpleLogger .variable ("Actual additional information" , actualAdditionalInformation );
31
+ SimpleLogger .variable ("Expected additional information" , expectedAdditionalInformation );
26
32
String helpMessage = "When using dynamic tests and Approvals, all calls to verify() must use the original Options or a derivative: \n "
27
33
+ " wrong: o -> Approvals.verify(result); \n " + " right: o -> Approvals.verify(result, o); \n "
28
34
+ " More at: https://github.com/approvals/ApprovalTests.Java/blob/master/approvaltests/docs/how_to/UseTestFactory.md" ;
0 commit comments