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());
}
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());
}
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());
}
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);
}
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;
}
Aggregations