use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class LdapAdapterTest method testGetTeam.
@Test
public void testGetTeam() throws Exception {
Logger log = createMock(Logger.class);
setField(ldapImpl, "log", log);
Project project = new Project();
TeamFilter teamFilter = new TeamFilter(FilterType.PROJECT_CODES, "_ART-PRJ-ART-TIME-PG");
project.setTeamFilter(teamFilter);
setField(ldapImpl, "workdaysCalendarRepository", workdaysCalendarRepository);
expect(workdaysCalendarRepository.findDefaultCalendar(anyObject(Employee.class))).andReturn(null).anyTimes();
replay(workdaysCalendarRepository);
List<Employee> team = ldapImpl.getTeam(project);
verify(workdaysCalendarRepository);
assertTrue(team.size() > 0);
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class LdapAdapterTest method testListEmployeesByTeamCodes.
@Test
public void testListEmployeesByTeamCodes() throws Exception {
Logger log = createMock(Logger.class);
setField(ldapImpl, "log", log);
Project project = new Project();
TeamFilter teamFilter = new TeamFilter(FilterType.PROJECT_CODES, "_ART-PRJ-ART-TIME-PG");
project.setTeamFilter(teamFilter);
setField(ldapImpl, "workdaysCalendarRepository", workdaysCalendarRepository);
expect(workdaysCalendarRepository.findDefaultCalendar(anyObject(Employee.class))).andReturn(null).anyTimes();
replay(workdaysCalendarRepository);
List<Employee> team = ldapImpl.getTeam(project);
verify(workdaysCalendarRepository);
assertTrue(team.size() > 0);
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class DepartmentRepositoryTest method testGetDepartments.
@Test
public void testGetDepartments() {
Employee employee1 = new Employee("emp1");
Employee employee2 = new Employee("emp2");
Employee employee3 = new Employee("emp3");
employee1.setDepartment("dep1");
employee2.setDepartment("dep2");
employee3.setDepartment("dep1");
entityManager.persist(employee1);
entityManager.persist(employee2);
entityManager.persist(employee3);
List<String> actual = departmentRepository.getDepartments();
assertEquals(2, actual.size());
assertTrue(actual.contains(employee1.getDepartment()));
assertTrue(actual.contains(employee2.getDepartment()));
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class EmployeeRepositoryTest method testFind_ByUsername.
@Test
public void testFind_ByUsername() {
Employee expectedEmployee = new Employee("expected employee");
Employee unexpectedEmployee = new Employee("unexpected employee");
entityManager.persist(expectedEmployee);
entityManager.persist(unexpectedEmployee);
Employee actual = employeeRepository.find("expected employee");
assertNotNull(actual);
assertEquals(expectedEmployee, actual);
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class EmployeeRepositoryTest method testCreateEmployee.
@Test
public void testCreateEmployee() {
Employee employee = new Employee("employee");
employeeRepository.create(employee);
Employee actual = entityManager.find(Employee.class, employee.getUserName());
assertNotNull(actual);
}
Aggregations