11package org .testcontainers .containers ;
22
33import lombok .Value ;
4- import org .junit .Test ;
5- import org .junit .runner . Description ;
6- import org .junit .runner . RunWith ;
7- import org .junit .runners . Parameterized ;
4+ import org .junit .jupiter . api . Test ;
5+ import org .junit .jupiter . api . TestInfo ;
6+ import org .junit .jupiter . params . ParameterizedClass ;
7+ import org .junit .jupiter . params . provider . MethodSource ;
88
99import java .io .File ;
1010import java .nio .file .Files ;
1717
1818import static org .assertj .core .api .Assertions .assertThat ;
1919
20- @ RunWith (Parameterized .class )
20+ @ ParameterizedClass
21+ @ MethodSource ("data" )
2122@ Value
22- public class DefaultRecordingFileFactoryTest {
23+ class DefaultRecordingFileFactoryTest {
2324
2425 private static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter .ofPattern ("YYYYMMdd-HHmmss" );
2526
@@ -31,7 +32,6 @@ public class DefaultRecordingFileFactoryTest {
3132
3233 private final boolean success ;
3334
34- @ Parameterized .Parameters
3535 public static Collection <Object []> data () {
3636 Collection <Object []> args = new ArrayList <>();
3737 args .add (new Object [] { "testMethod1" , "FAILED" , Boolean .FALSE });
@@ -40,13 +40,10 @@ public static Collection<Object[]> data() {
4040 }
4141
4242 @ Test
43- public void recordingFileThatShouldDescribeTheTestResultAtThePresentTime () throws Exception {
43+ public void recordingFileThatShouldDescribeTheTestResultAtThePresentTime (TestInfo testInfo ) throws Exception {
4444 File vncRecordingDirectory = Files .createTempDirectory ("recording" ).toFile ();
45- Description description = Description .createTestDescription (
46- getClass ().getCanonicalName (),
47- methodName ,
48- Test .class
49- );
45+ String className = testInfo .getTestClass ().orElseThrow (IllegalStateException ::new ).getSimpleName ();
46+ String description = className + "-" + methodName ;
5047
5148 File recordingFile = factory .recordingFileForTest (vncRecordingDirectory , description , success );
5249
0 commit comments