diff --git a/spring-jpa/pom.xml b/spring-jpa/pom.xml index 2c189bde4b..5acdae7765 100644 --- a/spring-jpa/pom.xml +++ b/spring-jpa/pom.xml @@ -189,13 +189,13 @@ - 4.2.5.RELEASE + 4.3.2.RELEASE 3.20.0-GA - 4.3.11.Final + 5.2.2.Final 5.1.38 - 1.8.2.RELEASE + 1.10.2.RELEASE 1.4.192 diff --git a/spring-jpa/src/test/java/org/baeldung/persistence/service/JpaMultipleDBIntegrationTest.java b/spring-jpa/src/test/java/org/baeldung/persistence/service/JpaMultipleDBIntegrationTest.java index e036a4f3c1..7e6b2722fa 100644 --- a/spring-jpa/src/test/java/org/baeldung/persistence/service/JpaMultipleDBIntegrationTest.java +++ b/spring-jpa/src/test/java/org/baeldung/persistence/service/JpaMultipleDBIntegrationTest.java @@ -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