Upgraded Hibernate to 5.2.2.Final version.

This commit is contained in:
bdragan
2016-08-09 21:49:36 +02:00
parent b60a8c3d7e
commit 2d61ab0615
2 changed files with 9 additions and 5 deletions
@@ -2,6 +2,7 @@ package org.baeldung.persistence.service;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import org.baeldung.config.ProductConfig;
import org.baeldung.config.UserConfig;
@@ -57,10 +58,13 @@ public class JpaMultipleDBIntegrationTest {
user2.setAge(10);
try {
user2 = userRepository.save(user2);
userRepository.flush();
fail("DataIntegrityViolationException should be thrown!");
} catch (final DataIntegrityViolationException e) {
// Expected
} catch (final Exception e) {
fail("DataIntegrityViolationException should be thrown, instead got: " + e);
}
assertNull(userRepository.findOne(user2.getId()));
}
@Test