Search in sources :

Example 11 with ObjectDeltaOperationListType

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);
}
Also used : ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) Collection(java.util.Collection) ObjectDeltaOperationListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType) ItemDeltaType(com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType)

Example 12 with ObjectDeltaOperationListType

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();
}
Also used : ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) ObjectDeltaOperationListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)

Example 13 with ObjectDeltaOperationListType

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();
}
Also used : ObjectDeltaOperationListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)

Example 14 with ObjectDeltaOperationListType

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);
}
Also used : ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) ObjectDeltaOperationListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)

Example 15 with ObjectDeltaOperationListType

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);
}
Also used : LogfileTestTailer(com.evolveum.midpoint.test.util.LogfileTestTailer) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) ObjectDeltaOperationListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType) ProtectedStringType(com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType) ObjectDeltaListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) Test(org.testng.annotations.Test)

Aggregations

ObjectDeltaOperationListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType)34 ObjectDeltaListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType)31 ObjectDeltaType (com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType)28 ObjectDeltaOperationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType)15 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)10 LogfileTestTailer (com.evolveum.midpoint.test.util.LogfileTestTailer)9 Test (org.testng.annotations.Test)9 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)7 ItemDeltaType (com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType)6 ModelExecuteOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.ModelExecuteOptionsType)4 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)4 RoleType (com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType)3 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)3 GenericObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType)2 FaultMessage (com.evolveum.midpoint.xml.ns._public.common.fault_3.FaultMessage)2 ExecuteChangesType (com.evolveum.midpoint.xml.ns._public.model.model_3.ExecuteChangesType)2 ModelPortType (com.evolveum.midpoint.xml.ns._public.model.model_3.ModelPortType)2 ProtectedStringType (com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType)2 Collection (java.util.Collection)2 QName (javax.xml.namespace.QName)2