use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method modifyObject.
protected ObjectDeltaOperationType modifyObject(Class objectType, String oid, String path, ModificationTypeType modType, Object value, ModelExecuteOptionsType optionsType, boolean assertSuccess) throws Exception {
System.out.println("Modifying " + objectType.getSimpleName() + " " + oid + " (path: " + path + ")");
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(objectType));
deltaType.setChangeType(ChangeTypeType.MODIFY);
deltaType.setOid(oid);
if (path != null) {
ItemDeltaType itemDelta = new ItemDeltaType();
itemDelta.setModificationType(modType);
itemDelta.setPath(createNonDefaultItemPathType(path));
if (!(value instanceof Collection)) {
itemDelta.getValue().add(value);
} else {
itemDelta.getValue().addAll((Collection) value);
}
deltaType.getItemDelta().add(itemDelta);
}
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType odolist = modelPort.executeChanges(deltaListType, optionsType);
return assertExecuteChangesSuccess(odolist, deltaType, assertSuccess);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class TestSanityLegacy method deleteObjectViaModelWS.
private OperationResultType deleteObjectViaModelWS(QName typeQName, String oid) throws FaultMessage {
ObjectDeltaListType deltaList = new ObjectDeltaListType();
ObjectDeltaType objectDelta = new ObjectDeltaType();
objectDelta.setOid(oid);
objectDelta.setObjectType(typeQName);
objectDelta.setChangeType(ChangeTypeType.DELETE);
deltaList.getDelta().add(objectDelta);
ObjectDeltaOperationListType list = modelWeb.executeChanges(deltaList, null);
return getOdoFromDeltaOperationList(list, objectDelta).getExecutionResult();
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class TestSanityLegacy method modifyObjectViaModelWS.
private OperationResultType modifyObjectViaModelWS(ObjectDeltaType objectChange) throws FaultMessage {
ObjectDeltaListType deltaList = new ObjectDeltaListType();
deltaList.getDelta().add(objectChange);
ObjectDeltaOperationListType list = modelWeb.executeChanges(deltaList, null);
return getOdoFromDeltaOperationList(list, objectChange).getExecutionResult();
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class AbstractWebserviceTest method deleteObject.
protected <O extends ObjectType> void deleteObject(Class<O> type, String oid, ModelExecuteOptionsType options) throws FaultMessage {
ObjectDeltaListType deltaList = new ObjectDeltaListType();
ObjectDeltaType delta = new ObjectDeltaType();
delta.setObjectType(getTypeQName(type));
delta.setChangeType(ChangeTypeType.DELETE);
delta.setOid(oid);
deltaList.getDelta().add(delta);
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, options);
assertSuccess(deltaOpList);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class TestWSSecurity method test160ChangeDarthAdderPasswordSatisfiesPolicyShortcut.
@Test
public void test160ChangeDarthAdderPasswordSatisfiesPolicyShortcut() throws Exception {
final String TEST_NAME = "test160ChangeDarthAdderPasswordSatisfiesPolicyShortcut";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD, WSConstants.PW_DIGEST);
ProtectedStringType protectedString = new ProtectedStringType();
protectedString.getContent().add(USER_DARTHADDER_PASSWORD_NEW1);
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(UserType.class, USER_DARTHADDER_OID, "credentials/password/value", ModificationTypeType.REPLACE, protectedString);
XMLGregorianCalendar startTs = TestUtil.currentTime();
// WHEN
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, null);
// THEN
assertSuccess(deltaOpList);
XMLGregorianCalendar endTs = TestUtil.currentTime();
tailer.tail();
displayAudit(tailer);
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "MODIFY_OBJECT");
tailer.assertAudit(4);
modelPort = createModelPort(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD_NEW1, WSConstants.PW_DIGEST);
UserType user = getObject(UserType.class, USER_DARTHADDER_OID);
display(user);
assertPasswordModifyMetadata(user, USER_DARTHADDER_OID, startTs, endTs);
}
Aggregations