use of eu.bcvsolutions.idm.acc.entity.SysProvisioningAttribute in project CzechIdMng by bcvsolutions.
the class DefaultProvisioningExecutorIntegrationTest method testFillProvisioningAttributes.
@Test
public void testFillProvisioningAttributes() {
SysSystemDto system = getHelper().createTestResourceSystem(true);
system.setReadonly(true);
system = systemService.save(system);
SysProvisioningOperationDto provisioningOperation = createProvisioningOperation(system, getHelper().createName());
// publish event
provisioningExecutor.execute(provisioningOperation);
//
SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
filter.setSystemEntity(provisioningOperation.getSystemEntity());
filter.setSystemId(system.getId());
filter.setEmptyProvisioning(Boolean.FALSE);
//
List<SysProvisioningOperationDto> operations = provisioningOperationService.find(filter, null).getContent();
Assert.assertFalse(operations.isEmpty());
provisioningOperation = operations.get(0);
List<SysProvisioningAttribute> attributes = provisioningAttributeRepository.findAllByProvisioningId(provisioningOperation.getId());
Assert.assertFalse(attributes.isEmpty());
//
system.setReadonly(false);
system = systemService.save(system);
//
provisioningExecutor.execute(provisioningOperation);
//
Assert.assertNull(provisioningOperationService.get(provisioningOperation.getId()));
// checkout skeleton provisioning attributes
attributes = provisioningAttributeRepository.findAllByProvisioningId(provisioningOperation.getId());
Assert.assertTrue(attributes.isEmpty());
}
use of eu.bcvsolutions.idm.acc.entity.SysProvisioningAttribute in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveServiceIntegrationTest method testOperationArchivateWithMultiUpdatedAttribute.
@Test
public void testOperationArchivateWithMultiUpdatedAttribute() {
SysSystemDto system = getHelper().createTestResourceSystem(false);
//
IcAttribute icAttributeOne = new IcAttributeImpl(getHelper().createName(), Lists.newArrayList("valueOne", "valueTwo"));
IcConnectorObject connectorObject = new IcConnectorObjectImpl(getHelper().createName(), new IcObjectClassImpl("__mock__"), ImmutableList.of(icAttributeOne));
//
SysProvisioningOperationDto operation = prepareProvisioningOperation(system);
operation.getProvisioningContext().setConnectorObject(connectorObject);
//
SysProvisioningArchiveDto archive = service.archive(operation);
//
List<SysProvisioningAttribute> attributes = provisioningAttributeRepository.findAllByProvisioningId(archive.getId());
//
Assert.assertEquals(1, attributes.size());
Assert.assertEquals(icAttributeOne.getName(), attributes.get(0).getName());
Assert.assertFalse(attributes.get(0).isRemoved());
}
use of eu.bcvsolutions.idm.acc.entity.SysProvisioningAttribute in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveServiceIntegrationTest method testOperationArchivateWithSingleUpdatedAttribute.
@Test
public void testOperationArchivateWithSingleUpdatedAttribute() {
SysSystemDto system = getHelper().createTestResourceSystem(false);
//
IcAttribute icAttributeOne = new IcAttributeImpl(getHelper().createName(), "valueOne");
IcConnectorObject connectorObject = new IcConnectorObjectImpl(getHelper().createName(), new IcObjectClassImpl("__mock__"), ImmutableList.of(icAttributeOne));
//
SysProvisioningOperationDto operation = prepareProvisioningOperation(system);
operation.getProvisioningContext().setConnectorObject(connectorObject);
//
SysProvisioningArchiveDto archive = service.archive(operation);
//
List<SysProvisioningAttribute> attributes = provisioningAttributeRepository.findAllByProvisioningId(archive.getId());
//
Assert.assertEquals(1, attributes.size());
Assert.assertEquals(icAttributeOne.getName(), attributes.get(0).getName());
Assert.assertFalse(attributes.get(0).isRemoved());
}
use of eu.bcvsolutions.idm.acc.entity.SysProvisioningAttribute in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveServiceIntegrationTest method testOperationArchivateWithMultiRemovedAttribute.
@Test
public void testOperationArchivateWithMultiRemovedAttribute() {
SysSystemDto system = getHelper().createTestResourceSystem(false);
//
IcAttribute icAttributeOne = new IcAttributeImpl(getHelper().createName(), Lists.newArrayList());
IcConnectorObject connectorObject = new IcConnectorObjectImpl(getHelper().createName(), new IcObjectClassImpl("__mock__"), ImmutableList.of(icAttributeOne));
//
SysProvisioningOperationDto operation = prepareProvisioningOperation(system);
operation.getProvisioningContext().setConnectorObject(connectorObject);
//
SysProvisioningArchiveDto archive = service.archive(operation);
//
List<SysProvisioningAttribute> attributes = provisioningAttributeRepository.findAllByProvisioningId(archive.getId());
//
Assert.assertEquals(1, attributes.size());
Assert.assertEquals(icAttributeOne.getName(), attributes.get(0).getName());
Assert.assertTrue(attributes.get(0).isRemoved());
}
use of eu.bcvsolutions.idm.acc.entity.SysProvisioningAttribute in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveServiceIntegrationTest method testOperationArchivateWithMultiRemovedAttributeWithNullValue.
@Test
public void testOperationArchivateWithMultiRemovedAttributeWithNullValue() {
SysSystemDto system = getHelper().createTestResourceSystem(false);
//
IcAttribute icAttributeOne = new IcAttributeImpl(getHelper().createName(), Lists.newArrayList((String) null));
IcConnectorObject connectorObject = new IcConnectorObjectImpl(getHelper().createName(), new IcObjectClassImpl("__mock__"), ImmutableList.of(icAttributeOne));
//
SysProvisioningOperationDto operation = prepareProvisioningOperation(system);
operation.getProvisioningContext().setConnectorObject(connectorObject);
//
SysProvisioningArchiveDto archive = service.archive(operation);
//
List<SysProvisioningAttribute> attributes = provisioningAttributeRepository.findAllByProvisioningId(archive.getId());
//
Assert.assertEquals(1, attributes.size());
Assert.assertEquals(icAttributeOne.getName(), attributes.get(0).getName());
Assert.assertTrue(attributes.get(0).isRemoved());
}
Aggregations