diff --git a/spring-hibernate4/src/test/java/org/baeldung/spring/persistence/service/FooServicePersistenceIntegrationTest.java b/spring-hibernate4/src/test/java/org/baeldung/spring/persistence/service/FooServicePersistenceIntegrationTest.java index cabb94c2f0..fae40cdad0 100644 --- a/spring-hibernate4/src/test/java/org/baeldung/spring/persistence/service/FooServicePersistenceIntegrationTest.java +++ b/spring-hibernate4/src/test/java/org/baeldung/spring/persistence/service/FooServicePersistenceIntegrationTest.java @@ -26,8 +26,14 @@ public class FooServicePersistenceIntegrationTest { } @Test - public final void whenEntityisCreated_thenNoExceptions() { + public final void whenEntityIsCreated_thenNoExceptions() { service.create(new Foo(randomAlphabetic(6))); } + // @Test(expected = DataIntegrityViolationException.class) + @Test + public final void whenInvalidEntityIsCreated_thenDataException() { + service.create(new Foo()); + } + }