use of eu.bcvsolutions.idm.acc.dto.SysProvisioningBreakConfigDto in project CzechIdMng by bcvsolutions.
the class ProvisioningBreakProcessorTest method testRecipientSystemntegrity.
@Test
public void testRecipientSystemntegrity() {
SysSystemDto systemDto = testHelper.createSystem(TestResource.TABLE_NAME);
SysProvisioningBreakConfigDto breakConfig = createProvisioningBreak(20l, null, null, ProvisioningEventType.CREATE, systemDto.getId());
//
SysProvisioningBreakConfigDto breakConfigFounded = provisioningBreakConfig.get(breakConfig.getId());
assertNotNull(breakConfigFounded);
//
systemService.delete(systemDto);
//
breakConfigFounded = provisioningBreakConfig.get(breakConfig.getId());
assertNull(breakConfigFounded);
}
use of eu.bcvsolutions.idm.acc.dto.SysProvisioningBreakConfigDto in project CzechIdMng by bcvsolutions.
the class ProvisioningBreakProcessorTest method testWarningCreateOperation.
@Test
public void testWarningCreateOperation() {
SysSystemDto system = testHelper.createTestResourceSystem(true);
IdmIdentityDto identity = testHelper.createIdentity();
IdmIdentityDto identity2 = testHelper.createIdentity();
IdmIdentityDto identity3 = testHelper.createIdentity();
SysProvisioningBreakConfigDto breakConfig = createProvisioningBreak(20l, null, 2, ProvisioningEventType.CREATE, system.getId());
IdmIdentityDto recipient = testHelper.createIdentity();
createRecipient(breakConfig.getId(), recipient.getId(), null);
//
this.createAccount(system, identity);
this.createAccount(system, identity2);
this.createAccount(system, identity3);
//
provisioningService.doProvisioning(identity);
provisioningService.doProvisioning(identity2);
provisioningService.doProvisioning(identity3);
//
IdmNotificationFilter filter = new IdmNotificationFilter();
filter.setRecipient(recipient.getUsername());
List<IdmNotificationLogDto> content = notificationLogService.find(filter, null).getContent();
// two notification (notification +
assertEquals(2, content.size());
// parent)
//
system = systemService.get(system.getId());
assertNotEquals(Boolean.TRUE, system.getBlockedOperation().getUpdateOperation());
assertNotEquals(Boolean.TRUE, system.getBlockedOperation().getCreateOperation());
assertNotEquals(Boolean.TRUE, system.getBlockedOperation().getDeleteOperation());
}
use of eu.bcvsolutions.idm.acc.dto.SysProvisioningBreakConfigDto in project CzechIdMng by bcvsolutions.
the class ProvisioningBreakProcessorTest method testWarningDeleteOperation.
@Test
public void testWarningDeleteOperation() {
SysSystemDto system = testHelper.createTestResourceSystem(true);
IdmIdentityDto identity = testHelper.createIdentity();
IdmIdentityDto identity2 = testHelper.createIdentity();
IdmIdentityDto identity3 = testHelper.createIdentity();
SysProvisioningBreakConfigDto breakConfig = createProvisioningBreak(20l, null, 2, ProvisioningEventType.DELETE, system.getId());
IdmIdentityDto recipient = testHelper.createIdentity();
createRecipient(breakConfig.getId(), recipient.getId(), null);
//
this.createAccount(system, identity);
this.createAccount(system, identity2);
this.createAccount(system, identity3);
//
provisioningService.doProvisioning(identity);
provisioningService.doProvisioning(identity2);
provisioningService.doProvisioning(identity3);
//
identityService.delete(identity);
identityService.delete(identity2);
identityService.delete(identity3);
//
IdmNotificationFilter filter = new IdmNotificationFilter();
filter.setRecipient(recipient.getUsername());
List<IdmNotificationLogDto> content = notificationLogService.find(filter, null).getContent();
// two notification (notification +
assertEquals(2, content.size());
// parent)
//
system = systemService.get(system.getId());
assertNotEquals(Boolean.TRUE, system.getBlockedOperation().getUpdateOperation());
assertNotEquals(Boolean.TRUE, system.getBlockedOperation().getCreateOperation());
assertNotEquals(Boolean.TRUE, system.getBlockedOperation().getDeleteOperation());
}
use of eu.bcvsolutions.idm.acc.dto.SysProvisioningBreakConfigDto in project CzechIdMng by bcvsolutions.
the class SystemDeleteProcessor method clearProvisioningBreakAndCache.
/**
* Method clear all provisioning cache for system.
*
* @param systemId
*/
private void clearProvisioningBreakAndCache(UUID systemId) {
provisioningBreakConfigService.clearCache(systemId, ProvisioningEventType.CREATE);
provisioningBreakConfigService.clearCache(systemId, ProvisioningEventType.DELETE);
provisioningBreakConfigService.clearCache(systemId, ProvisioningEventType.UPDATE);
//
SysProvisioningBreakConfigDto config = provisioningBreakConfigService.getConfig(ProvisioningEventType.CREATE, systemId);
if (config != null) {
provisioningBreakConfigService.delete(config);
}
//
config = provisioningBreakConfigService.getConfig(ProvisioningEventType.UPDATE, systemId);
if (config != null) {
provisioningBreakConfigService.delete(config);
}
//
config = provisioningBreakConfigService.getConfig(ProvisioningEventType.DELETE, systemId);
if (config != null) {
provisioningBreakConfigService.delete(config);
}
}
use of eu.bcvsolutions.idm.acc.dto.SysProvisioningBreakConfigDto in project CzechIdMng by bcvsolutions.
the class ProvisioningBreakProcessorTest method createProvisioningBreak.
/**
* Create provisioning break for given system with given attributes
*
* @param period
* @param disableLimit
* @param warningLimit
* @param eventType
* @param systemId
* @return
*/
private SysProvisioningBreakConfigDto createProvisioningBreak(Long period, Integer disableLimit, Integer warningLimit, ProvisioningEventType eventType, UUID systemId) {
SysProvisioningBreakConfigDto config = new SysProvisioningBreakConfigDto();
config.setOperationType(eventType);
config.setPeriod(period);
config.setDisableLimit(disableLimit);
config.setWarningLimit(warningLimit);
config.setSystem(systemId);
return provisioningBreakConfig.save(config);
}
Aggregations