use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType 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.ObjectDeltaListType 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.ObjectDeltaListType 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);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.
the class TestWSSanity method test020AddResourceOpenDj.
@Test
public void test020AddResourceOpenDj() throws Exception {
final String TEST_NAME = "test020AddResourceOpenDj";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
ResourceType resource = ModelClientUtil.unmarshallFile(RESOURCE_OPENDJ_FILE);
ObjectDeltaListType deltaList = new ObjectDeltaListType();
ObjectDeltaType delta = new ObjectDeltaType();
delta.setObjectType(getTypeQName(ResourceType.class));
delta.setChangeType(ChangeTypeType.ADD);
delta.setObjectToAdd(resource);
deltaList.getDelta().add(delta);
ModelExecuteOptionsType options = new ModelExecuteOptionsType();
options.setIsImport(Boolean.TRUE);
XMLGregorianCalendar startTs = TestUtil.currentTime();
// WHEN
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, options);
// THEN
assertSuccess(deltaOpList);
String oid = deltaOpList.getDeltaOperation().get(0).getObjectDelta().getOid();
XMLGregorianCalendar endTs = TestUtil.currentTime();
tailer.tail();
displayAudit(tailer);
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "ADD_OBJECT");
tailer.assertAudit(4);
assertEquals("Wrong OID", RESOURCE_OPENDJ_OID, oid);
ResourceType resourceAfter = getObject(ResourceType.class, RESOURCE_OPENDJ_OID);
display(resourceAfter);
assertEquals("Wrong connector OID", connectorLdapOid, resourceAfter.getConnectorRef().getOid());
assertCreateMetadata(resourceAfter, USER_ADMINISTRATOR_OID, startTs, endTs);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.
the class TestWSSecurity method test165DarthAdderDeleteOwnPassword.
@Test
public void test165DarthAdderDeleteOwnPassword() throws Exception {
final String TEST_NAME = "test165DarthAdderDeleteOwnPassword";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(UserType.class, USER_DARTHADDER_OID, "credentials/password", // no values here
ModificationTypeType.REPLACE);
// 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);
assertNull("Credentials sneaked in: " + user.getCredentials(), user.getCredentials());
}
Aggregations