Skip to content

Commit 2453070

Browse files
committed
repeat
1 parent 9e30b53 commit 2453070

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

class/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@
106106
<groupId>org.openjdk.jmh</groupId>
107107
<artifactId>jmh-generator-annprocess</artifactId>
108108
</dependency>
109+
<dependency>
110+
<groupId>org.junit.jupiter</groupId>
111+
<artifactId>junit-jupiter</artifactId>
112+
<scope>test</scope>
113+
</dependency>
109114

110115
</dependencies>
111116

class/src/test/java/security/aes/AESUtilTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import lombok.extern.slf4j.Slf4j;
66
import org.junit.Assert;
77
import org.junit.Test;
8+
import org.junit.jupiter.api.RepeatedTest;
89

910
import javax.crypto.KeyGenerator;
1011
import javax.crypto.SealedObject;
@@ -49,6 +50,7 @@ public void testFlow() throws Exception {
4950
}
5051

5152
@Test
53+
@RepeatedTest(6)
5254
public void testHexKeyFlow() throws Exception {
5355
// 生成随机密钥
5456
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@
162162
<artifactId>junit</artifactId>
163163
<version>4.13.2</version>
164164
</dependency>
165+
<dependency>
166+
<groupId>org.junit</groupId>
167+
<artifactId>junit-bom</artifactId>
168+
<version>5.12.2</version>
169+
<type>pom</type>
170+
<scope>import</scope>
171+
</dependency>
165172
<dependency>
166173
<groupId>org.mockito</groupId>
167174
<artifactId>mockito-core</artifactId>

test/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@
3131
<groupId>org.openjdk.jmh</groupId>
3232
<artifactId>jmh-generator-annprocess</artifactId>
3333
</dependency>
34+
<dependency>
35+
<groupId>org.testng</groupId>
36+
<artifactId>testng</artifactId>
37+
<scope>test</scope>
38+
</dependency>
39+
<!-- https://github.com/junit-team/junit5-samples/blob/r5.12.2/junit5-jupiter-starter-maven/pom.xml-->
40+
<dependency>
41+
<groupId>org.junit.jupiter</groupId>
42+
<artifactId>junit-jupiter</artifactId>
43+
<scope>test</scope>
44+
</dependency>
3445

3546
</dependencies>
3647

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package junit5;
2+
3+
4+
import org.junit.jupiter.api.RepeatedTest;
5+
6+
/**
7+
* @author Kuangcp
8+
* 2025-04-15 21:24
9+
*/
10+
public class RepeatTest {
11+
12+
@RepeatedTest(5)
13+
public void testRepeat() throws Exception {
14+
System.out.println("xxxxxx");
15+
}
16+
}

0 commit comments

Comments
 (0)