general example cleanup

This commit is contained in:
eugenp
2013-08-12 23:23:33 +03:00
parent 14c76d379a
commit 62292a5e5a
4 changed files with 6 additions and 112 deletions
@@ -1,9 +1,8 @@
package org.baeldung.ex.mappingexception;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
import org.baeldung.ex.mappingexception.cause1.persistence.model.Foo;
import org.baeldung.ex.mappingexception.spring.Cause1PersistenceConfig;
import org.hibernate.MappingException;
import org.hibernate.SessionFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -22,10 +21,10 @@ public class Cause1MappingExceptionIntegrationTest {
// tests
@Test
@Test(expected = MappingException.class)
@Transactional
public final void givenEntityIsPersisted_thenException() {
sessionFactory.getCurrentSession().saveOrUpdate(new Foo(randomAlphabetic(6)));
sessionFactory.getCurrentSession().saveOrUpdate(new Foo());
}
}
@@ -1,9 +1,8 @@
package org.baeldung.ex.mappingexception;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
import org.baeldung.ex.mappingexception.cause2.persistence.model.Foo;
import org.baeldung.ex.mappingexception.spring.Cause2PersistenceConfig;
import org.hibernate.MappingException;
import org.hibernate.SessionFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -22,10 +21,10 @@ public class Cause2MappingExceptionIntegrationTest {
// tests
@Test
@Test(expected = MappingException.class)
@Transactional
public final void givenEntityIsPersisted_thenException() {
sessionFactory.getCurrentSession().saveOrUpdate(new Foo(randomAlphabetic(6)));
sessionFactory.getCurrentSession().saveOrUpdate(new Foo());
}
}