9
9
import java .util .List ;
10
10
11
11
import org .hibernate .HibernateException ;
12
- import org .hibernate .cfg .Configuration ;
13
12
import org .hibernate .reactive .mutiny .Mutiny ;
14
13
15
14
import org .junit .Test ;
18
17
import jakarta .persistence .Column ;
19
18
import jakarta .persistence .Entity ;
20
19
import jakarta .persistence .Id ;
21
- import jakarta .persistence .PersistenceException ;
22
20
23
21
public class MutinyExceptionsTest extends BaseReactiveTest {
24
22
@@ -27,15 +25,8 @@ protected Collection<Class<?>> annotatedEntities() {
27
25
return List .of ( Person .class );
28
26
}
29
27
30
- @ Override
31
- protected Configuration constructConfiguration () {
32
- Configuration configuration = super .constructConfiguration ();
33
- configuration .setProperty ( "native_exception_handling_51_compliance" , "false" );
34
- return configuration ;
35
- }
36
-
37
28
Class <?> getExpectedException () {
38
- return PersistenceException .class ;
29
+ return HibernateException .class ;
39
30
}
40
31
41
32
@ Test
@@ -75,22 +66,4 @@ public String toString() {
75
66
return name + ", " + uniqueName ;
76
67
}
77
68
}
78
-
79
- // TODO: [ORM-6] Check if this property still makes sense
80
- // I don't think we need to support this case but at the moment it would require more work to
81
- // disable the behaviour.
82
- public static class Native51ExceptionHandlingTest extends MutinyExceptionsTest {
83
-
84
- @ Override
85
- Class <?> getExpectedException () {
86
- return HibernateException .class ;
87
- }
88
-
89
- @ Override
90
- protected Configuration constructConfiguration () {
91
- Configuration configuration = super .constructConfiguration ();
92
- configuration .setProperty ( "native_exception_handling_51_compliance" , "true" );
93
- return configuration ;
94
- }
95
- }
96
69
}
0 commit comments