use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.
the class AbstractTestForExchangeConnector method createOrg.
protected String createOrg(OrgType orgType) throws FaultMessage {
ObjectDeltaType deltaType = new ObjectDeltaType();
deltaType.setObjectType(ModelClientUtil.getTypeQName(OrgType.class));
deltaType.setChangeType(ChangeTypeType.ADD);
deltaType.setObjectToAdd(orgType);
ObjectDeltaListType deltaListType = new ObjectDeltaListType();
deltaListType.getDelta().add(deltaType);
ObjectDeltaOperationListType operationListType = modelPort.executeChanges(deltaListType, null);
return ModelClientUtil.getOidFromDeltaOperationList(operationListType, deltaType);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.
the class AbstractWebserviceTest method checkAuditEnabled.
private void checkAuditEnabled(SystemConfigurationType configurationType) throws FaultMessage {
LoggingConfigurationType loggingConfig = configurationType.getLogging();
AuditingConfigurationType auditConfig = loggingConfig.getAuditing();
if (auditConfig == null) {
auditConfig = new AuditingConfigurationType();
auditConfig.setEnabled(true);
loggingConfig.setAuditing(auditConfig);
} else {
if (BooleanUtils.isTrue(auditConfig.isEnabled())) {
return;
}
auditConfig.setEnabled(true);
}
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(SystemConfigurationType.class, SystemObjectsType.SYSTEM_CONFIGURATION.value(), "logging", ModificationTypeType.REPLACE, loggingConfig);
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, null);
assertSuccess(deltaOpList);
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.
the class AbstractWebserviceTest method addObject.
protected <O extends ObjectType> String addObject(O object) throws FaultMessage {
ObjectDeltaListType deltaList = new ObjectDeltaListType();
ObjectDeltaType delta = new ObjectDeltaType();
delta.setObjectType(getTypeQName(object.getClass()));
delta.setChangeType(ChangeTypeType.ADD);
delta.setObjectToAdd(object);
deltaList.getDelta().add(delta);
ObjectDeltaOperationListType deltaOpList = modelPort.executeChanges(deltaList, null);
assertSuccess(deltaOpList);
return deltaOpList.getDeltaOperation().get(0).getObjectDelta().getOid();
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.
the class TestWSSecurity method test142DisableHimselfAsDarthAdder.
@Test
public void test142DisableHimselfAsDarthAdder() throws Exception {
final String TEST_NAME = "test142DisableHimselfAsDarthAdder";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(UserType.class, USER_DARTHADDER_OID, "activation/administrativeStatus", ModificationTypeType.REPLACE, ActivationStatusType.DISABLED);
// 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);
assertEquals("Wrong administrative status in " + ModelClientUtil.toString(user), ActivationStatusType.DISABLED, user.getActivation().getAdministrativeStatus());
}
use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectDeltaListType in project midpoint by Evolveum.
the class TestWSSecurity method test162ChangeDarthAdderPasswordViolatesPolicy.
@Test
public void test162ChangeDarthAdderPasswordViolatesPolicy() throws Exception {
final String TEST_NAME = "test162ChangeDarthAdderPasswordViolatesPolicy";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
ProtectedStringType protectedString = ModelClientUtil.createProtectedString("x");
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(UserType.class, USER_DARTHADDER_OID, "credentials/password/value", ModificationTypeType.REPLACE, protectedString);
try {
// WHEN
modelPort.executeChanges(deltaList, null);
AssertJUnit.fail("Unexpected success");
} catch (FaultMessage e) {
assertFaultMessage(e, PolicyViolationFaultType.class, "password does not satisfy password policies");
}
// THEN
tailer.tail();
displayAudit(tailer);
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "MODIFY_OBJECT", OperationResultStatusType.FATAL_ERROR, "password does not satisfy password policies");
tailer.assertAudit(4);
UserType user = getObject(UserType.class, USER_DARTHADDER_OID);
display(user);
PasswordType dartAdderPassword = user.getCredentials().getPassword();
assertEquals("Password of DarthAdder has changed", ModelClientUtil.marshallToSting(new QName("http://whatever/", "fake"), dartAdderLastPassword, false), ModelClientUtil.marshallToSting(new QName("http://whatever/", "fake"), dartAdderPassword, false));
assertPasswordModifyMetadata(user, USER_DARTHADDER_OID, dartAdderLastPasswordChangeStartTs, dartAdderLastPasswordChangeEndTs);
}
Aggregations