File tree Expand file tree Collapse file tree 6 files changed +71
-34
lines changed
src/test/java/org/hibernate/validator/bugs
src/test/java/org/hibernate/validator/bugs
src/test/java/org/hibernate/validator/bugs Expand file tree Collapse file tree 6 files changed +71
-34
lines changed Original file line number Diff line number Diff line change 10
10
<properties >
11
11
<version .org.hibernate.validator>6.2.5.Final</version .org.hibernate.validator>
12
12
<version .javax.el>3.0.1-b12</version .javax.el>
13
- <version .junit>4.13.2</version .junit>
14
13
<version .log4j>2.24.3</version .log4j>
14
+ <version .junit-jupiter>5.11.3</version .junit-jupiter>
15
15
</properties >
16
16
17
+ <dependencyManagement >
18
+ <dependencies >
19
+ <dependency >
20
+ <groupId >org.junit</groupId >
21
+ <artifactId >junit-bom</artifactId >
22
+ <version >${version.junit-jupiter} </version >
23
+ <type >pom</type >
24
+ <scope >import</scope >
25
+ </dependency >
26
+ </dependencies >
27
+ </dependencyManagement >
28
+
17
29
<dependencies >
18
30
<dependency >
19
31
<groupId >org.hibernate.validator</groupId >
33
45
</dependency >
34
46
35
47
<dependency >
36
- <groupId >junit</groupId >
37
- <artifactId >junit</artifactId >
38
- <version >${version.junit} </version >
48
+ <groupId >org.junit.jupiter</groupId >
49
+ <artifactId >junit-jupiter</artifactId >
39
50
<scope >test</scope >
40
51
</dependency >
41
52
Original file line number Diff line number Diff line change 1
1
package org .hibernate .validator .bugs ;
2
2
3
- import static org .junit .Assert .assertEquals ;
4
3
5
- import java . util . Set ;
4
+ import static org . junit . jupiter . api . Assertions . assertEquals ;
6
5
6
+ import java .util .Set ;
7
7
import javax .validation .ConstraintViolation ;
8
8
import javax .validation .Validation ;
9
9
import javax .validation .Validator ;
10
10
import javax .validation .ValidatorFactory ;
11
11
12
12
import org .hibernate .validator .testutil .TestForIssue ;
13
- import org .junit .BeforeClass ;
14
- import org .junit .Test ;
15
13
16
- public class YourTestCase {
14
+ import org .junit .jupiter .api .BeforeAll ;
15
+ import org .junit .jupiter .api .Test ;
16
+
17
+ class YourTestCase {
17
18
18
19
private static Validator validator ;
19
20
20
- @ BeforeClass
21
+ @ BeforeAll
21
22
public static void setUp () {
22
23
ValidatorFactory factory = Validation .buildDefaultValidatorFactory ();
23
24
validator = factory .getValidator ();
24
25
}
25
26
26
27
@ Test
27
28
@ TestForIssue (jiraKey = "HV-NNNNN" ) // Please fill in the JIRA key of your issue
28
- public void testYourBug () {
29
+ void testYourBug () {
29
30
YourAnnotatedBean yourEntity1 = new YourAnnotatedBean ( null , "example" );
30
31
31
32
Set <ConstraintViolation <YourAnnotatedBean >> constraintViolations = validator .validate ( yourEntity1 );
32
33
assertEquals ( 1 , constraintViolations .size () );
33
34
assertEquals (
34
35
"must not be null" ,
35
- constraintViolations .iterator ().next ().getMessage () );
36
+ constraintViolations .iterator ().next ().getMessage ()
37
+ );
36
38
}
37
39
38
40
}
Original file line number Diff line number Diff line change 10
10
<properties >
11
11
<version .org.hibernate.validator>8.0.2.Final</version .org.hibernate.validator>
12
12
<version .org.glassfish.expressly>5.0.0</version .org.glassfish.expressly>
13
- <version .junit>4.13.2</version .junit>
14
13
<version .log4j>2.24.3</version .log4j>
14
+ <version .junit-jupiter>5.11.3</version .junit-jupiter>
15
15
</properties >
16
16
17
+ <dependencyManagement >
18
+ <dependencies >
19
+ <dependency >
20
+ <groupId >org.junit</groupId >
21
+ <artifactId >junit-bom</artifactId >
22
+ <version >${version.junit-jupiter} </version >
23
+ <type >pom</type >
24
+ <scope >import</scope >
25
+ </dependency >
26
+ </dependencies >
27
+ </dependencyManagement >
28
+
17
29
<dependencies >
18
30
<dependency >
19
31
<groupId >org.hibernate.validator</groupId >
33
45
</dependency >
34
46
35
47
<dependency >
36
- <groupId >junit</groupId >
37
- <artifactId >junit</artifactId >
38
- <version >${version.junit} </version >
48
+ <groupId >org.junit.jupiter</groupId >
49
+ <artifactId >junit-jupiter</artifactId >
39
50
<scope >test</scope >
40
51
</dependency >
41
52
Original file line number Diff line number Diff line change 1
1
package org .hibernate .validator .bugs ;
2
2
3
- import static org .junit .Assert .assertEquals ;
3
+ import static org .junit .jupiter . api . Assertions .assertEquals ;
4
4
5
5
import java .util .Set ;
6
6
7
+ import org .hibernate .validator .testutil .TestForIssue ;
8
+
9
+ import org .junit .jupiter .api .BeforeAll ;
10
+ import org .junit .jupiter .api .Test ;
11
+
7
12
import jakarta .validation .ConstraintViolation ;
8
13
import jakarta .validation .Validation ;
9
14
import jakarta .validation .Validator ;
10
15
import jakarta .validation .ValidatorFactory ;
11
16
12
- import org .hibernate .validator .testutil .TestForIssue ;
13
- import org .junit .BeforeClass ;
14
- import org .junit .Test ;
15
-
16
- public class YourTestCase {
17
+ class YourTestCase {
17
18
18
19
private static Validator validator ;
19
20
20
- @ BeforeClass
21
+ @ BeforeAll
21
22
public static void setUp () {
22
23
ValidatorFactory factory = Validation .buildDefaultValidatorFactory ();
23
24
validator = factory .getValidator ();
24
25
}
25
26
26
27
@ Test
27
28
@ TestForIssue (jiraKey = "HV-NNNNN" ) // Please fill in the JIRA key of your issue
28
- public void testYourBug () {
29
+ void testYourBug () {
29
30
YourAnnotatedBean yourEntity1 = new YourAnnotatedBean ( null , "example" );
30
31
31
32
Set <ConstraintViolation <YourAnnotatedBean >> constraintViolations = validator .validate ( yourEntity1 );
32
33
assertEquals ( 1 , constraintViolations .size () );
33
34
assertEquals (
34
35
"must not be null" ,
35
- constraintViolations .iterator ().next ().getMessage () );
36
+ constraintViolations .iterator ().next ().getMessage ()
37
+ );
36
38
}
37
39
38
40
}
Original file line number Diff line number Diff line change 10
10
<properties >
11
11
<version .org.hibernate.validator>9.0.0.CR1</version .org.hibernate.validator>
12
12
<version .org.glassfish.expressly>6.0.0-M1</version .org.glassfish.expressly>
13
- <version .junit>4.13.2</version .junit>
14
13
<version .log4j>2.24.3</version .log4j>
15
14
<version .assertj-core>3.26.3</version .assertj-core>
15
+ <version .junit-jupiter>5.11.3</version .junit-jupiter>
16
16
</properties >
17
17
18
+ <dependencyManagement >
19
+ <dependencies >
20
+ <dependency >
21
+ <groupId >org.junit</groupId >
22
+ <artifactId >junit-bom</artifactId >
23
+ <version >${version.junit-jupiter} </version >
24
+ <type >pom</type >
25
+ <scope >import</scope >
26
+ </dependency >
27
+ </dependencies >
28
+ </dependencyManagement >
29
+
18
30
<dependencies >
19
31
<dependency >
20
32
<groupId >org.hibernate.validator</groupId >
34
46
</dependency >
35
47
36
48
<dependency >
37
- <groupId >junit</groupId >
38
- <artifactId >junit</artifactId >
39
- <version >${version.junit} </version >
49
+ <groupId >org.junit.jupiter</groupId >
50
+ <artifactId >junit-jupiter</artifactId >
40
51
<scope >test</scope >
41
52
</dependency >
42
53
Original file line number Diff line number Diff line change 8
8
9
9
import org .hibernate .validator .testutil .TestForIssue ;
10
10
11
- import org .junit .BeforeClass ;
12
- import org .junit .Test ;
11
+ import org .junit .jupiter . api . BeforeAll ;
12
+ import org .junit .jupiter . api . Test ;
13
13
14
14
import jakarta .validation .ConstraintViolation ;
15
15
import jakarta .validation .Validation ;
16
16
import jakarta .validation .Validator ;
17
17
import jakarta .validation .ValidatorFactory ;
18
18
import jakarta .validation .constraints .NotNull ;
19
19
20
- public class YourTestCase {
20
+ class YourTestCase {
21
21
22
22
private static Validator validator ;
23
23
24
- @ BeforeClass
24
+ @ BeforeAll
25
25
public static void setUp () {
26
26
ValidatorFactory factory = Validation .buildDefaultValidatorFactory ();
27
27
validator = factory .getValidator ();
28
28
}
29
29
30
30
@ Test
31
31
@ TestForIssue (jiraKey = "HV-NNNNN" ) // Please fill in the JIRA key of your issue
32
- public void testYourBug () {
32
+ void testYourBug () {
33
33
YourAnnotatedBean yourEntity1 = new YourAnnotatedBean ( null , "example" );
34
34
35
35
Set <ConstraintViolation <YourAnnotatedBean >> constraintViolations = validator .validate ( yourEntity1 );
You can’t perform that action at this time.
0 commit comments