Search in sources :

Example 1 with WorkdaysCalendarRepository

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();
}
Also used : ProjectRepository(com.artezio.arttime.services.repositories.ProjectRepository) WorkdaysCalendarRepository(com.artezio.arttime.services.repositories.WorkdaysCalendarRepository) HoursRepository(com.artezio.arttime.services.repositories.HoursRepository) Before(org.junit.Before)

Aggregations

HoursRepository (com.artezio.arttime.services.repositories.HoursRepository)1 ProjectRepository (com.artezio.arttime.services.repositories.ProjectRepository)1 WorkdaysCalendarRepository (com.artezio.arttime.services.repositories.WorkdaysCalendarRepository)1 Before (org.junit.Before)1