minor cleanup work
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.baeldung.hibernate.manytomany;
|
||||
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import org.hibernate.Session;
|
||||
@@ -17,10 +16,8 @@ import com.baeldung.hibernate.manytomany.model.Employee;
|
||||
import com.baeldung.hibernate.manytomany.model.Project;
|
||||
import com.baeldung.manytomany.spring.PersistenceConfig;
|
||||
|
||||
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class)
|
||||
@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class)
|
||||
public class HibernateManyToManyAnnotationJavaConfigMainIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
@@ -28,7 +25,6 @@ public class HibernateManyToManyAnnotationJavaConfigMainIntegrationTest {
|
||||
|
||||
private Session session;
|
||||
|
||||
|
||||
@Before
|
||||
public final void before() {
|
||||
session = sessionFactory.openSession();
|
||||
@@ -43,11 +39,11 @@ public class HibernateManyToManyAnnotationJavaConfigMainIntegrationTest {
|
||||
|
||||
@Test
|
||||
public final void whenEntitiesAreCreated_thenNoExceptions() {
|
||||
Set<Project> projects = new HashSet<Project>();
|
||||
projects.add(new Project("IT Project"));
|
||||
projects.add(new Project("Networking Project"));
|
||||
session.persist(new Employee("Peter", "Oven", projects));
|
||||
session.persist(new Employee("Allan", "Norman", projects));
|
||||
Set<Project> projects = new HashSet<Project>();
|
||||
projects.add(new Project("IT Project"));
|
||||
projects.add(new Project("Networking Project"));
|
||||
session.persist(new Employee("Peter", "Oven", projects));
|
||||
session.persist(new Employee("Allan", "Norman", projects));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user