use of com.artezio.arttime.services.repositories.HoursRepository 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();
}
use of com.artezio.arttime.services.repositories.HoursRepository in project ART-TIME by Artezio.
the class ReportedHoursIndicatorTest method setUp.
@Before
public void setUp() throws Exception {
hoursIndicator = createMockBuilder(ReportedHoursIndicator.class).addMockedMethod("getFilter").createMock();
employee = new Employee("employee");
period = new Period();
hoursRepository = createMock(HoursRepository.class);
workTimeService = createMock(WorkTimeService.class);
employeeRepository = createMock(EmployeeRepository.class);
filter = createMock(Filter.class);
hourTypeRepository = createMock(HourTypeRepository.class);
hoursIndicator.setEmployee(employee);
setField(hoursIndicator, "hoursRepository", hoursRepository);
setField(hoursIndicator, "workTimeService", workTimeService);
setField(hoursIndicator, "employeeRepository", employeeRepository);
setField(hoursIndicator, "hourTypeRepository", hourTypeRepository);
}
Aggregations