use of eu.bcvsolutions.idm.acc.dto.SysSystemDto in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemServiceFilterTest method testSystemPasswordPolicyValidationId.
@Test
public void testSystemPasswordPolicyValidationId() {
SysSystemDto system1 = createSystem("test001" + System.currentTimeMillis(), null);
createSystem("test002" + System.currentTimeMillis(), null);
SysSystemFilter testFilter = new SysSystemFilter();
IdmPasswordPolicyDto policy = createPasswordPolicy("first", IdmPasswordPolicyType.VALIDATE);
system1.setPasswordPolicyValidate(policy.getId());
system1 = systemService.save(system1);
testFilter.setPasswordPolicyValidationId(policy.getId());
//
Page<SysSystemDto> pages = systemService.find(testFilter, null);
assertEquals(1, pages.getTotalElements());
assertEquals(system1.getId(), pages.getContent().get(0).getId());
}
use of eu.bcvsolutions.idm.acc.dto.SysSystemDto in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemServiceFilterTest method testSystemPasswordPolicyGenerationId.
@Test
public void testSystemPasswordPolicyGenerationId() {
SysSystemDto system1 = createSystem("test01" + System.currentTimeMillis(), null);
createSystem("test02" + System.currentTimeMillis(), null);
SysSystemFilter testFilter = new SysSystemFilter();
IdmPasswordPolicyDto policy = createPasswordPolicy("second", IdmPasswordPolicyType.GENERATE);
system1.setPasswordPolicyGenerate(policy.getId());
system1 = systemService.save(system1);
testFilter.setPasswordPolicyGenerationId(policy.getId());
//
Page<SysSystemDto> pages = systemService.find(testFilter, null);
assertEquals(1, pages.getTotalElements());
assertEquals(system1.getId(), pages.getContent().get(0).getId());
}
use of eu.bcvsolutions.idm.acc.dto.SysSystemDto in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemServiceFilterTest method testSystemNameFilter.
@Test
public void testSystemNameFilter() {
SysSystemDto system1 = createSystem("test001" + System.currentTimeMillis(), null);
createSystem("test002" + System.currentTimeMillis(), null);
//
SysSystemFilter testFilter = new SysSystemFilter();
testFilter.setText(system1.getName());
Page<SysSystemDto> pages = systemService.find(testFilter, null);
assertEquals(1, pages.getTotalElements());
assertEquals(system1.getId(), pages.getContent().get(0).getId());
}
use of eu.bcvsolutions.idm.acc.dto.SysSystemDto in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemServiceFilterTest method createSystem.
/**
* Create {@link SysSystemDto}
*
* @param systemName
* @param virtual
* @return
*/
private SysSystemDto createSystem(String systemName, Boolean virtual) {
SysSystemDto system = new SysSystemDto();
system.setName(systemName);
if (virtual != null) {
system.setVirtual(virtual);
}
return systemService.save(system);
}
use of eu.bcvsolutions.idm.acc.dto.SysSystemDto in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemServiceTest method testReferentialIntegrityAccountExists.
@Test(expected = ResultCodeException.class)
public void testReferentialIntegrityAccountExists() {
SysSystemDto system = new SysSystemDto();
String systemName = "t_s_" + System.currentTimeMillis();
system.setName(systemName);
system = systemService.save(system);
// account
AccAccountDto account = new AccAccountDto();
account.setSystem(system.getId());
account.setUid("test_uid_" + System.currentTimeMillis());
account.setAccountType(AccountType.PERSONAL);
account = accountService.save(account);
systemService.delete(system);
}
Aggregations