use of com.artezio.arttime.services.repositories.WorkdaysCalendarRepository in project ART-TIME by Artezio.
the class WorkTimeServiceTest method setUp.
@Before
public void setUp() throws Exception {
workTimeService = new WorkTimeService();
Map<String, String> properties = new HashMap<>();
properties.put("javax.persistence.validation.mode", "none");
entityManagerFactory = Persistence.createEntityManagerFactory("test", properties);
entityManager = entityManagerFactory.createEntityManager();
ProjectRepository projectRepository = new ProjectRepository();
WorkdaysCalendarRepository workdaysCalendarRepository = new WorkdaysCalendarRepository();
HoursRepository hoursRepository = new HoursRepository();
setField(projectRepository, "entityManager", entityManager);
setField(workdaysCalendarRepository, "entityManager", entityManager);
setField(hoursRepository, "entityManager", entityManager);
setField(workTimeService, "projectRepository", projectRepository);
setField(workTimeService, "workdaysCalendarRepository", workdaysCalendarRepository);
setField(workTimeService, "hoursRepository", hoursRepository);
entityManager.getTransaction().begin();
}
Aggregations