use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType 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.ObjectDeltaOperationListType 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());
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class TestWSSecurity method test140AssignRoleToDarthAdderAsAdministrator.
@Test
public void test140AssignRoleToDarthAdderAsAdministrator() throws Exception {
final String TEST_NAME = "test140AssignRoleToDarthAdderAsAdministrator";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort();
ObjectDeltaListType deltaList = ModelClientUtil.createAssignDeltaList(UserType.class, USER_DARTHADDER_OID, RoleType.class, ROLE_MODIFIER_OID);
// 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);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class TestWSSecurity method test141ModifyTitleAsDarthAdder.
@Test
public void test141ModifyTitleAsDarthAdder() throws Exception {
final String TEST_NAME = "test141ModifyTitleAsDarthAdder";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD, WSConstants.PW_DIGEST);
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(UserType.class, USER_DARTHADDER_OID, "title", ModificationTypeType.REPLACE, ModelClientUtil.createPolyStringType("Dark Lord"));
// 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);
UserType user = getObject(UserType.class, USER_DARTHADDER_OID);
PolyStringType title = user.getTitle();
assertEquals("Wrong title", "Dark Lord", ModelClientUtil.getOrig(title));
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaOperationListType in project midpoint by Evolveum.
the class Main method createRole.
private static String createRole(ModelPortType modelPort, RoleType roleType) throws FaultMessage {
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(RoleType.class));
deltaType.setChangeType(ChangeTypeType.ADD);
deltaType.setObjectToAdd(roleType);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType operationListType = modelPort.executeChanges(deltaListType, null);
return ModelClientUtil.getOidFromDeltaOperationList(operationListType, deltaType);
}
Aggregations