Search in sources :

Example 36 with SysSystemDto

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());
}
Also used : IdmPasswordPolicyDto(eu.bcvsolutions.idm.core.api.dto.IdmPasswordPolicyDto) SysSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemFilter) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 37 with SysSystemDto

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());
}
Also used : IdmPasswordPolicyDto(eu.bcvsolutions.idm.core.api.dto.IdmPasswordPolicyDto) SysSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemFilter) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 38 with SysSystemDto

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());
}
Also used : SysSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemFilter) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 39 with SysSystemDto

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);
}
Also used : SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto)

Example 40 with SysSystemDto

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);
}
Also used : AccAccountDto(eu.bcvsolutions.idm.acc.dto.AccAccountDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)256 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)167 Test (org.junit.Test)167 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)98 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)82 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)56 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)52 SysSchemaObjectClassDto (eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)50 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)45 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)42 SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)42 SysProvisioningOperationDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto)32 SysSystemEntityDto (eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto)32 IcConnectorObject (eu.bcvsolutions.idm.ic.api.IcConnectorObject)30 AbstractSysSyncConfigDto (eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto)29 SysSyncLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncLogDto)29 SysProvisioningOperationFilter (eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter)29 SysSchemaAttributeDto (eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)28 AccIdentityAccountDto (eu.bcvsolutions.idm.acc.dto.AccIdentityAccountDto)27 IdmBasePermission (eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission)27