Skip to content

Commit e386576

Browse files
committed
upgraded junit to 5.13 to show-case new feature @ParameterizedClass
1 parent ca19cd3 commit e386576

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<dependency>
1818
<groupId>org.junit</groupId>
1919
<artifactId>junit-bom</artifactId>
20-
<version>5.10.1</version>
20+
<version>5.13.0</version>
2121
<type>pom</type>
2222
<scope>import</scope>
2323
</dependency>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package org.sammancoaching.parameterizedtests.concept;
2+
3+
import org.junit.jupiter.api.Test;
4+
import org.junit.jupiter.params.Parameter;
5+
import org.junit.jupiter.params.ParameterizedClass;
6+
import org.junit.jupiter.params.ParameterizedTest;
7+
import org.junit.jupiter.params.provider.*;
8+
9+
import java.util.List;
10+
11+
import static java.util.Arrays.asList;
12+
import static java.util.Collections.emptyList;
13+
import static org.assertj.core.api.Assertions.assertThat;
14+
import static org.junit.jupiter.api.Assertions.assertEquals;
15+
16+
@ParameterizedClass
17+
@ValueSource(strings = { "foo", "bar", "###", "___", " " })
18+
class ParameterizedClassTests {
19+
20+
@Parameter
21+
String string;
22+
23+
@Test
24+
void checkOneOnString() {
25+
// call the code to test that should do some work when getting a string
26+
}
27+
28+
@Test
29+
void checkTwoOnString() {
30+
// call other code to test that should do some work when getting a string
31+
}
32+
33+
}

0 commit comments

Comments
 (0)