Search in sources :

Example 1 with VsSystemDto

use of eu.bcvsolutions.idm.vs.dto.VsSystemDto in project CzechIdMng by bcvsolutions.

the class VsSystemServiceTest method createVirtualSystemTest.

@Test
public void createVirtualSystemTest() {
    VsSystemDto config = new VsSystemDto();
    config.setName(VS_SYSTEM);
    SysSystemDto system = helper.createVirtualSystem(config);
    Assert.assertNotNull(system);
    Assert.assertEquals(system.getName(), VS_SYSTEM);
    Assert.assertEquals(true, system.isVirtual());
}
Also used : VsSystemDto(eu.bcvsolutions.idm.vs.dto.VsSystemDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 2 with VsSystemDto

use of eu.bcvsolutions.idm.vs.dto.VsSystemDto in project CzechIdMng by bcvsolutions.

the class VsSystemServiceTest method checkDefaultImplementersTest.

@Test
public /**
 * If none implementers role is set, then we use as implementers all users
 * with 'superAdminRole'
 */
void checkDefaultImplementersTest() {
    VsSystemDto config = new VsSystemDto();
    config.setName(VS_SYSTEM);
    SysSystemDto system = helper.createVirtualSystem(config);
    Assert.assertNotNull(system);
    List<IdmIdentityDto> implementes = systemImplementersService.findRequestImplementers(system.getId());
    Assert.assertEquals(1, implementes.size());
    Assert.assertEquals("admin", implementes.get(0).getUsername());
}
Also used : VsSystemDto(eu.bcvsolutions.idm.vs.dto.VsSystemDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 3 with VsSystemDto

use of eu.bcvsolutions.idm.vs.dto.VsSystemDto in project CzechIdMng by bcvsolutions.

the class VsSystemServiceTest method checkSpecificImplementerRoleTest.

@Test
public /**
 * If none implementers role is set, then we use as implementers all users
 * with 'superAdminRole'
 */
void checkSpecificImplementerRoleTest() {
    String userOneName = "vsUserOne";
    String roleOneName = "vsRoleOne";
    IdmIdentityDto userTwo = helper.createIdentity(userOneName);
    IdmRoleDto roleOne = helper.createRole(roleOneName);
    helper.assignRoles(helper.getPrimeContract(userTwo.getId()), false, roleOne);
    this.configurationService.setValue(VsConfiguration.PROPERTY_DEFAULT_ROLE, roleOneName);
    VsSystemDto config = new VsSystemDto();
    config.setName(VS_SYSTEM);
    SysSystemDto system = helper.createVirtualSystem(config);
    Assert.assertNotNull(system);
    List<IdmIdentityDto> implementes = systemImplementersService.findRequestImplementers(system.getId());
    Assert.assertEquals(1, implementes.size());
    Assert.assertEquals(userOneName, implementes.get(0).getUsername());
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) VsSystemDto(eu.bcvsolutions.idm.vs.dto.VsSystemDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 4 with VsSystemDto

use of eu.bcvsolutions.idm.vs.dto.VsSystemDto in project CzechIdMng by bcvsolutions.

the class DefaultTestHelper method createVirtualSystem.

@Override
public SysSystemDto createVirtualSystem(String name) {
    VsSystemDto dto = new VsSystemDto();
    dto.setName(name);
    return this.createVirtualSystem(dto);
}
Also used : VsSystemDto(eu.bcvsolutions.idm.vs.dto.VsSystemDto)

Example 5 with VsSystemDto

use of eu.bcvsolutions.idm.vs.dto.VsSystemDto in project CzechIdMng by bcvsolutions.

the class VsReqeustServiceTest method createVirtualSystem.

private SysSystemDto createVirtualSystem(String userImplementerName, List<String> attributes) {
    IdmIdentityDto userImplementer = helper.createIdentity(userImplementerName);
    VsSystemDto config = new VsSystemDto();
    config.setName("vsSystemOne" + new Date().getTime());
    config.setImplementers(ImmutableList.of(userImplementer.getId()));
    if (attributes != null) {
        config.setAttributes(attributes);
    }
    SysSystemDto system = helper.createVirtualSystem(config);
    Assert.assertNotNull(system);
    return system;
}
Also used : VsSystemDto(eu.bcvsolutions.idm.vs.dto.VsSystemDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) Date(java.util.Date) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto)

Aggregations

VsSystemDto (eu.bcvsolutions.idm.vs.dto.VsSystemDto)6 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)5 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)4 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)4 Test (org.junit.Test)4 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)2 Date (java.util.Date)1