mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-18 00:55:16 +00:00
HHH-12802 : Fix test case to recover from exception properly
(cherry picked from commit 9202a5a11d56ca6565963f3f9aa59b92421ec5fb)
This commit is contained in:
parent
3af8b6235a
commit
7e69797a45
@ -57,18 +57,18 @@ public void setup() {
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-12802" )
|
||||
public void testLoadEntityWithNonUniqueId() {
|
||||
doInHibernate(
|
||||
this::sessionFactory,
|
||||
session -> {
|
||||
try {
|
||||
session.get( Category.class, 1 );
|
||||
fail( "should have failed because there are 2 entities with id == 1" );
|
||||
try {
|
||||
doInHibernate(
|
||||
this::sessionFactory,
|
||||
session -> {
|
||||
session.get( Category.class, 1 );
|
||||
fail( "should have failed because there are 2 entities with id == 1" );
|
||||
}
|
||||
catch ( HibernateException ex) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
catch ( HibernateException ex) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
@Entity
|
||||
|
Loading…
x
Reference in New Issue
Block a user