use of com.artezio.arttime.config.Settings in project ART-TIME by Artezio.
the class LdapAdapterIntegrationTest method createLdapClient.
private LdapClient createLdapClient() {
Settings settings = new Settings(new HashMap<>());
settings.setLdapBindCredentials("");
settings.setLdapPrincipalUsername("");
settings.setLdapPrincipalSuffix("");
settings.setLdapServerHost("localhost");
settings.setLdapServerPort(10389);
settings.setLdapMailAttribute("");
settings.setLdapLastNameAttribute("sn");
settings.setLdapFirstNameAttribute("givenName");
settings.setLdapUserNameAttribute("sAMAccountName");
settings.setLdapDepartmentAttribute("physicalDeliveryOfficeName");
settings.setLdapUserContextDN("ou=users,dc=example,dc=com");
settings.setLdapEmployeeFilter("(&(objectClass=person)(sn=*)(givenName=*))");
settings.setLdapGroupMemberFilter("(memberOf=ou={0},ou=users,dc=example,dc=com)");
settings.setLdapUserFilter("(&(objectclass=*)(sAMAccountName={0}))");
settings.setLdapDepartmentFilterDepartmentAttribute("physicalDeliveryOfficeName");
settings.setLdapDepartmentFilter("(&(physicalDeliveryOfficeName=*)(objectClass=person))");
return new LdapClient(settings);
}
use of com.artezio.arttime.config.Settings in project ART-TIME by Artezio.
the class SettingsServiceTest method testGetSettings_ifNoSettingsExist.
@Test
public void testGetSettings_ifNoSettingsExist() {
Settings actual = settingsService.getSettings();
assertNotNull(actual);
}
use of com.artezio.arttime.config.Settings in project ART-TIME by Artezio.
the class SettingsServiceTest method testUpdateSettings.
@Test
public void testUpdateSettings() {
Setting setting1 = new Setting(Setting.Name.LDAP_BIND_CREDENTIALS, "old_value1");
Setting setting2 = new Setting(Setting.Name.SMTP_HOST_NAME, "old_value2");
entityManager.persist(setting1);
entityManager.persist(setting2);
entityManager.flush();
Settings settings = settingsService.getSettings();
settings.setLdapBindCredentials("new_value");
settings.setSmtpHostName(null);
settingsService.update(settings);
Settings newSettings = settingsService.getSettings();
assertTrue(newSettings.getLdapBindCredentials().equals("new_value"));
assertNull(newSettings.getSmtpHostName());
}
use of com.artezio.arttime.config.Settings in project ART-TIME by Artezio.
the class LdapClientTest method setUp.
@Before
public void setUp() throws NoSuchFieldException {
settings = new Settings(new HashMap<>());
setField(ldapClient, "settings", settings);
}
use of com.artezio.arttime.config.Settings in project ART-TIME by Artezio.
the class SchedulerTest method setUp.
@Before
public void setUp() throws NoSuchFieldException {
scheduler = new Scheduler();
settings = new Settings(new EnumMap<>(Setting.Name.class));
IMocksControl mockControl = EasyMock.createControl();
synchronizer = mockControl.createMock(Synchronizer.class);
setField(scheduler, "settings", settings);
setField(scheduler, "synchronizer", synchronizer);
}
Aggregations