use of com.artezio.arttime.datamodel.TeamFilter in project ART-TIME by Artezio.
the class LdapAdapterTest method testListEmployeesByTeamCodes_TwoTeamCodes.
@Test
public void testListEmployeesByTeamCodes_TwoTeamCodes() 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,_ART-PRJ-ART-TIME-PM");
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.TeamFilter in project ART-TIME by Artezio.
the class LdapAdapterTest method testGetTeam_ByNativeFilter.
@Test
public void testGetTeam_ByNativeFilter() throws Exception {
Logger log = createMock(Logger.class);
setField(ldapImpl, "log", log);
Project project = new Project();
TeamFilter teamFilter = new TeamFilter(FilterType.NATIVE, "(&(objectClass=user)(physicalDeliveryOfficeName=Minsk))");
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.TeamFilter in project ART-TIME by Artezio.
the class LdapAdapterTest method testGetTeam_DisabledFilter.
@Test
public void testGetTeam_DisabledFilter() throws Exception {
Logger log = createMock(Logger.class);
setField(ldapImpl, "log", log);
Project project = new Project();
TeamFilter teamFilter = new TeamFilter(FilterType.DISABLED, "");
project.setTeamFilter(teamFilter);
List<Employee> team = ldapImpl.getTeam(project);
assertEquals(0, team.size());
}
use of com.artezio.arttime.datamodel.TeamFilter in project ART-TIME by Artezio.
the class TeamSynchronizerTest method testGetTeam.
@Test
public void testGetTeam() {
Project project = new Project();
project.setTeamFilter(new TeamFilter(TeamFilter.Type.DISABLED));
List<Employee> actual = teamSynchronizer.getTeam(project);
assertTrue(actual.isEmpty());
}
use of com.artezio.arttime.datamodel.TeamFilter in project ART-TIME by Artezio.
the class TeamSynchronizerTest method testGetTeam_basedOnMasterFilterType.
@Test
public void testGetTeam_basedOnMasterFilterType() {
Project master = new Project();
master.setTeamFilter(new TeamFilter(TeamFilter.Type.DISABLED));
Project project = new Project(master);
project.setTeamFilter(new TeamFilter(TeamFilter.Type.BASED_ON_MASTER));
List<Employee> actual = teamSynchronizer.getTeam(project);
assertTrue(actual.isEmpty());
}
Aggregations