use of com.evolveum.midpoint.test.util.LogfileTestTailer in project midpoint by Evolveum.
the class TestWSSecurity method test111GetConfigGoodPasswordText.
@Test
public void test111GetConfigGoodPasswordText() throws Exception {
final String TEST_NAME = "test111GetConfigGoodPasswordText";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_ADMINISTRATOR_USERNAME, USER_ADMINISTRATOR_PASSWORD, WSConstants.PW_TEXT);
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);
}
use of com.evolveum.midpoint.test.util.LogfileTestTailer in project midpoint by Evolveum.
the class TestWSSecurity method test108GetConfigBlankUsernameText.
@Test
public void test108GetConfigBlankUsernameText() throws Exception {
final String TEST_NAME = "test108GetConfigBlankUsernameText";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(" ", 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 username");
}
use of com.evolveum.midpoint.test.util.LogfileTestTailer in project midpoint by Evolveum.
the class TestWSSecurity method test100GetConfigNoSecurity.
@Test
public void test100GetConfigNoSecurity() throws Exception {
final String TEST_NAME = "test100GetConfigNoSecurity";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(null, null);
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, "InvalidSecurity", "<wsse:Security> header");
}
tailer.tail();
assertAuditLoginFailed(tailer, "<wsse:Security> header");
}
use of com.evolveum.midpoint.test.util.LogfileTestTailer in project midpoint by Evolveum.
the class TestWSSecurity method test143GetConfigAsDarthAdderGoodPasswordDigest.
@Test
public void test143GetConfigAsDarthAdderGoodPasswordDigest() throws Exception {
final String TEST_NAME = "test143GetConfigAsDarthAdderGoodPasswordDigest";
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>();
try {
/// WHEN
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");
}
// THEN
tailer.tail();
assertAuditLoginFailed(tailer, "user disabled");
}
use of com.evolveum.midpoint.test.util.LogfileTestTailer in project midpoint by Evolveum.
the class TestWSSecurity method test107GetConfigBlankUsernameDigest.
@Test
public void test107GetConfigBlankUsernameDigest() throws Exception {
final String TEST_NAME = "test107GetConfigBlankUsernameDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(" ", USER_ADMINISTRATOR_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 username");
}
Aggregations