use of javax.xml.ws.Holder in project midpoint by Evolveum.
the class TestWSSecurity method test166GetConfigAsDarthAdder.
/**
* Darth Adder has no password.
*/
@Test
public void test166GetConfigAsDarthAdder() throws Exception {
final String TEST_NAME = "test166GetConfigAsDarthAdder";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD_NEW2, 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, "no credentials in user");
}
use of javax.xml.ws.Holder in project midpoint by Evolveum.
the class TestWSSecurity method test101GetConfigWrongPasswordDigest.
@Test
public void test101GetConfigWrongPasswordDigest() throws Exception {
final String TEST_NAME = "test101GetConfigWrongPasswordDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_ADMINISTRATOR_USERNAME, "wrongAdministratorPassword", 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, "could not be authenticated or authorized");
}
use of javax.xml.ws.Holder in project midpoint by Evolveum.
the class TestWSSecurity method test102GetConfigWrongPasswordText.
@Test
public void test102GetConfigWrongPasswordText() throws Exception {
final String TEST_NAME = "test102GetConfigWrongPasswordText";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_ADMINISTRATOR_USERNAME, "wrongAdministratorPassword", 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");
}
}
use of javax.xml.ws.Holder in project midpoint by Evolveum.
the class TestWSSecurity method test103GetConfigEmptyPasswordDigest.
@Test
public void test103GetConfigEmptyPasswordDigest() throws Exception {
final String TEST_NAME = "test103GetConfigEmptyPasswordDigest";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
modelPort = createModelPort(USER_ADMINISTRATOR_USERNAME, "", 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, "could not be authenticated or authorized");
}
use of javax.xml.ws.Holder in project midpoint by Evolveum.
the class AbstractWebserviceTest method cleanObjects.
private <O extends ObjectType> void cleanObjects(Class<O> type, boolean raw, String... protectedOids) throws FaultMessage {
Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
Holder<ObjectListType> objectListHolder = new Holder<ObjectListType>();
SelectorQualifiedGetOptionsType rootOpts = null;
ModelExecuteOptionsType execOpts = null;
if (raw) {
rootOpts = ModelClientUtil.createRootGetOptions(ModelClientUtil.createRawGetOption());
execOpts = ModelClientUtil.createRawExecuteOption();
}
modelPort.searchObjects(getTypeQName(type), null, rootOpts, objectListHolder, resultHolder);
List<String> protectedOidList = Arrays.asList(protectedOids);
ObjectListType objectList = objectListHolder.value;
for (ObjectType object : objectList.getObject()) {
if (!protectedOidList.contains(object.getOid())) {
display("Deleting " + type.getSimpleName() + " " + ModelClientUtil.toString(object));
deleteObject(type, object.getOid(), execOpts);
}
}
}
Aggregations