use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.
the class TestModelWebServiceNegative method test100ModifyAccountExplicitType.
/**
* First tests are positive, to make sure that this method works.
*/
@Test
public void test100ModifyAccountExplicitType() throws Exception {
final String TEST_NAME = "test100ModifyUserAddAccount";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestModelWebServiceNegative.class.getName() + "." + TEST_NAME);
ObjectDeltaType objectChange = createShadowReplaceChange(ACCOUNT_SHADOW_GUYBRUSH_OID, "attributes/" + DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, "foo", DOMUtil.XSD_STRING);
ObjectDeltaListType deltaList = new ObjectDeltaListType();
deltaList.getDelta().add(objectChange);
// WHEN
modelWeb.executeChanges(deltaList, null);
// THEN
// Check account in dummy resource
assertDefaultDummyAccount(ACCOUNT_GUYBRUSH_DUMMY_USERNAME, ACCOUNT_GUYBRUSH_DUMMY_FULLNAME, true);
assertDummyAccountAttribute(null, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, "foo");
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method createAccountOdo.
protected ObjectDeltaOperationType createAccountOdo(String givenName, String sn, String name, String recipientType, String overrideMail) throws FaultMessage {
ShadowType shadowType = prepareShadowType(givenName, sn, name, recipientType, overrideMail, null, null, null);
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(ShadowType.class));
deltaType.setChangeType(ChangeTypeType.ADD);
deltaType.setObjectToAdd(shadowType);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType operationListType = modelPort.executeChanges(deltaListType, null);
return ModelClientUtil.findInDeltaOperationList(operationListType, deltaType);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method deleteTask.
protected void deleteTask(String oid) throws FaultMessage {
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(TaskType.class));
deltaType.setChangeType(ChangeTypeType.DELETE);
deltaType.setOid(oid);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ModelExecuteOptionsType executeOptionsType = new ModelExecuteOptionsType();
executeOptionsType.setRaw(true);
modelPort.executeChanges(deltaListType, executeOptionsType);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType 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.ObjectDeltaListType 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();
}
Aggregations