HHH-12802 : Fix test case to recover from exception properly

This commit is contained in:
Gail Badner 2018-07-13 15:51:39 -07:00
parent 926ad5a133
commit 9202a5a11d
1 changed files with 11 additions and 11 deletions

View File

@ -57,18 +57,18 @@ public class NonUniqueIdTest extends BaseNonConfigCoreFunctionalTestCase {
@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