use of com.evolveum.midpoint.test.util.LogfileTestTailer in project midpoint by Evolveum.
the class TestWSSecurity method test106GetConfigWrongUsernameText.
@Test
public void test106GetConfigWrongUsernameText() throws Exception {
final String TEST_NAME = "test106GetConfigWrongUsernameText";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort("admin", USER_ADMINISTRATOR_PASSWORD, WSConstants.PW_TEXT);
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 user");
}
use of com.evolveum.midpoint.test.util.LogfileTestTailer 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.test.util.LogfileTestTailer in project midpoint by Evolveum.
the class TestWSSecurity method test133ModifyConfigAsSomebody.
@Test
public void test133ModifyConfigAsSomebody() throws Exception {
final String TEST_NAME = "test133ModifyConfigAsSomebody";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
ObjectReferenceType ref = new ObjectReferenceType();
// fake
ref.setOid("c4e998e6-d903-11e4-9aaf-001e8c717e5b");
ObjectDeltaListType deltaList = ModelClientUtil.createModificationDeltaList(SystemConfigurationType.class, SystemObjectsType.SYSTEM_CONFIGURATION.value(), "globalSecurityPolicyRef", ModificationTypeType.REPLACE, ref);
try {
// WHEN
modelPort.executeChanges(deltaList, null);
AssertJUnit.fail("Unexpected success");
} catch (SOAPFaultException e) {
assertSoapFault(e, "FailedAuthentication", "could not be authenticated or authorized");
}
// THEN
tailer.tail();
displayAudit(tailer);
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "MODIFY_OBJECT", OperationResultStatusType.FATAL_ERROR, "not authorized");
tailer.assertAudit(4);
}
use of com.evolveum.midpoint.test.util.LogfileTestTailer 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.test.util.LogfileTestTailer in project midpoint by Evolveum.
the class TestWSSecurity method test135AssignRoleAsDarthAdder.
@Test
public void test135AssignRoleAsDarthAdder() throws Exception {
final String TEST_NAME = "test135ModifyConfigAsDarthAdder";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
ObjectDeltaListType deltaList = ModelClientUtil.createAssignDeltaList(UserType.class, USER_DARTHADDER_OID, RoleType.class, ROLE_MODIFIER_OID);
try {
// WHEN
modelPort.executeChanges(deltaList, null);
AssertJUnit.fail("Unexpected success");
} catch (SOAPFaultException e) {
assertSoapFault(e, "FailedAuthentication", "could not be authenticated or authorized");
}
// THEN
tailer.tail();
displayAudit(tailer);
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "MODIFY_OBJECT", OperationResultStatusType.FATAL_ERROR, "not authorized");
tailer.assertAudit(4);
}
Aggregations