minor cleanup work

This commit is contained in:
Eugen Paraschiv 2017-11-27 15:56:07 +02:00
parent 6536e39622
commit ebc25b2b41
2 changed files with 13 additions and 11 deletions

View File

@ -28,8 +28,14 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<version>4.12</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<dependencyManagement>

View File

@ -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));
}
}