use of org.mitre.cybox.cybox_2.ObjectType in project midpoint by Evolveum.
the class TestPreviewChanges method modifyUserAddAccountImplicitExplicitSameReverse.
private void modifyUserAddAccountImplicitExplicitSameReverse(String bundleName, ObjectSource<PrismObject<ShadowType>> accountSource, ObjectChecker<ModelContext<UserType>> checker) throws Exception {
final String TEST_NAME = bundleName + "ImplicitExplicitSameReverse";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestPreviewChanges.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<ShadowType> account = accountSource.get();
ObjectDelta<UserType> userDelta = ObjectDelta.createEmptyModifyDelta(UserType.class, USER_JACK_OID, prismContext);
PrismReferenceValue accountRefVal = new PrismReferenceValue();
accountRefVal.setObject(account);
ReferenceDelta accountRefDelta = ReferenceDelta.createModificationAdd(UserType.F_LINK_REF, getUserDefinition(), accountRefVal);
userDelta.addModification(accountRefDelta);
ObjectDelta<ShadowType> accountDelta = account.createAddDelta();
Collection<ObjectDelta<? extends ObjectType>> deltas = MiscSchemaUtil.createCollection(accountDelta, userDelta);
doPreview(deltas, checker, task, result);
}
use of org.mitre.cybox.cybox_2.ObjectType in project midpoint by Evolveum.
the class TestWSSanity method test112CheckJackAccountShadowRaw.
@Test
public void test112CheckJackAccountShadowRaw() throws Exception {
final String TEST_NAME = "test112CheckJackAccountShadowRaw";
displayTestTitle(TEST_NAME);
Holder<ObjectType> objectHolder = new Holder<>();
Holder<OperationResultType> resultHolder = new Holder<>();
// WHEN
modelPort.getObject(ModelClientUtil.getTypeQName(ShadowType.class), accountJackOid, ModelClientUtil.createRootGetOptions(ModelClientUtil.createRawGetOption()), objectHolder, resultHolder);
// THEN
assertSuccess(resultHolder);
ShadowType shadow = (ShadowType) objectHolder.value;
display(shadow);
assertAttribute(shadow, ATTR_ICF_NAME_NAME, "uid=" + USER_JACK_USERNAME + "," + openDJController.getSuffixPeople());
assertNoAttribute(shadow, "uid");
assertNoAttribute(shadow, "givenName");
assertNoAttribute(shadow, "sn");
assertNoAttribute(shadow, "cn");
assertNoAttribute(shadow, "displayName");
}
use of org.mitre.cybox.cybox_2.ObjectType in project midpoint by Evolveum.
the class TestWSSanity method test111CheckJackAccountShadow.
@Test
public void test111CheckJackAccountShadow() throws Exception {
final String TEST_NAME = "test111CheckJackAccountShadow";
displayTestTitle(TEST_NAME);
Holder<ObjectType> objectHolder = new Holder<>();
Holder<OperationResultType> resultHolder = new Holder<>();
// WHEN
modelPort.getObject(ModelClientUtil.getTypeQName(ShadowType.class), accountJackOid, null, objectHolder, resultHolder);
// THEN
assertSuccess(resultHolder);
ShadowType shadow = (ShadowType) objectHolder.value;
display(shadow);
assertAttribute(shadow, ATTR_ICF_NAME_NAME, "uid=" + USER_JACK_USERNAME + "," + openDJController.getSuffixPeople());
assertAttribute(shadow, "uid", "jack");
assertAttribute(shadow, "givenName", "Jack");
assertAttribute(shadow, "sn", "Sparrow");
assertAttribute(shadow, "cn", "Jack Sparrow");
assertAttribute(shadow, "displayName", "Jack Sparrow");
}
use of org.mitre.cybox.cybox_2.ObjectType in project midpoint by Evolveum.
the class TestWSSecurity method test123GetConfigAsNobodyGoodPasswordDigest.
@Test
public void test123GetConfigAsNobodyGoodPasswordDigest() throws Exception {
final String TEST_NAME = "test123GetConfigAsNobodyGoodPasswordDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_NOBODY_USERNAME, USER_NOBODY_PASSWORD, WSConstants.PW_DIGEST);
Holder<ObjectType> objectHolder = new Holder<ObjectType>();
Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
// WHEN
try {
modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
AssertJUnit.fail("Unexpected success");
} catch (SOAPFaultException e) {
assertSoapSecurityFault(e, "FailedAuthentication", "could not be authenticated or authorized");
}
tailer.tail();
assertAuditLoginFailed(tailer, "no authorizations");
}
use of org.mitre.cybox.cybox_2.ObjectType in project midpoint by Evolveum.
the class TestWSSecurity method test134GetConfigAsDarthAdderGoodPasswordDigest.
@Test
public void test134GetConfigAsDarthAdderGoodPasswordDigest() throws Exception {
final String TEST_NAME = "test134GetConfigAsDarthAdderGoodPasswordDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD, WSConstants.PW_DIGEST);
Holder<ObjectType> objectHolder = new Holder<ObjectType>();
Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
/// WHEN
modelPort.getObject(getTypeQName(SystemConfigurationType.class), SystemObjectsType.SYSTEM_CONFIGURATION.value(), null, objectHolder, resultHolder);
// THEN
assertSuccess(resultHolder);
tailer.tail();
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
tailer.assertAudit(2);
}
Aggregations