use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method createOrg.
protected String createOrg(OrgType orgType) throws FaultMessage {
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(OrgType.class));
deltaType.setChangeType(ChangeTypeType.ADD);
deltaType.setObjectToAdd(orgType);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType operationListType = modelPort.executeChanges(deltaListType, null);
return ModelClientUtil.getOidFromDeltaOperationList(operationListType, deltaType);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class TestSanityLegacy method getOdoFromDeltaOperationList.
// ugly hack...
private static ObjectDeltaOperationType getOdoFromDeltaOperationList(ObjectDeltaOperationListType operationListType, ObjectDeltaType originalDelta) {
Validate.notNull(operationListType);
Validate.notNull(originalDelta);
for (ObjectDeltaOperationType operationType : operationListType.getDeltaOperation()) {
ObjectDeltaType objectDeltaType = operationType.getObjectDelta();
if (originalDelta.getChangeType() == ChangeTypeType.ADD) {
if (objectDeltaType.getChangeType() == originalDelta.getChangeType() && objectDeltaType.getObjectToAdd() != null) {
ObjectType objectAdded = (ObjectType) objectDeltaType.getObjectToAdd();
if (objectAdded.getClass().equals(originalDelta.getObjectToAdd().getClass())) {
return operationType;
}
}
} else {
if (objectDeltaType.getChangeType() == originalDelta.getChangeType() && originalDelta.getOid().equals(objectDeltaType.getOid())) {
return operationType;
}
}
}
throw new IllegalStateException("No suitable ObjectDeltaOperationType (" + originalDelta.getChangeType() + ")found. We have: " + operationListType);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class AbstractWebserviceTest method checkAuditEnabled.
private void checkAuditEnabled(SystemConfigurationType configurationType) throws FaultMessage {
LoggingConfigurationType loggingConfig = configurationType.getLogging();
AuditingConfigurationType auditConfig = loggingConfig.getAuditing();
if (auditConfig == null) {
auditConfig = new AuditingConfigurationType();
auditConfig.setEnabled(true);
loggingConfig.setAuditing(auditConfig);
} else {
if (BooleanUtils.isTrue(auditConfig.isEnabled())) {
return;
}
auditConfig.setEnabled(true);
}
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(SystemConfigurationType.class, SystemObjectsType.SYSTEM_CONFIGURATION.value(), "logging", ModificationTypeType.REPLACE, loggingConfig);
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, null);
assertSuccess(deltaOpList);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class AbstractWebserviceTest method addObject.
protected <O extends ObjectType> String addObject(O object) throws FaultMessage {
ObjectDeltaListType deltaList = new ObjectDeltaListType();
ObjectDeltaType delta = new ObjectDeltaType();
delta.setObjectType(getTypeQName(object.getClass()));
delta.setChangeType(ChangeTypeType.ADD);
delta.setObjectToAdd(object);
deltaList.getDelta().add(delta);
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, null);
assertSuccess(deltaOpList);
return deltaOpList.getDeltaOperation().get(0).getObjectDelta().getOid();
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class TestWSSecurity method test142DisableHimselfAsDarthAdder.
@Test
public void test142DisableHimselfAsDarthAdder() throws Exception {
final String TEST_NAME = "test142DisableHimselfAsDarthAdder";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(UserType.class, USER_DARTHADDER_OID, "activation/administrativeStatus", ModificationTypeType.REPLACE, ActivationStatusType.DISABLED);
// WHEN
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, null);
// THEN
assertSuccess(deltaOpList);
tailer.tail();
displayAudit(tailer);
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "MODIFY_OBJECT");
tailer.assertAudit(4);
modelPort = createModelPort();
UserType user = getObject(UserType.class, USER_DARTHADDER_OID);
display(user);
assertEquals("Wrong administrative status in " + ModelClientUtil.toString(user), ActivationStatusType.DISABLED, user.getActivation().getAdministrativeStatus());
}
Aggregations