use of javax.xml.ws.Holder in project midpoint by Evolveum.
the class TestSanityLegacy method test480ListResources.
@Test
public void test480ListResources() throws Exception {
final String TEST_NAME = "test480ListResources";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
OperationResultType result = new OperationResultType();
Holder<OperationResultType> resultHolder = new Holder<OperationResultType>(result);
Holder<ObjectListType> objectListHolder = new Holder<ObjectListType>();
SelectorQualifiedGetOptionsType options = new SelectorQualifiedGetOptionsType();
// WHEN
modelWeb.searchObjects(ObjectTypes.RESOURCE.getTypeQName(), null, options, objectListHolder, resultHolder);
// THEN
display("Resources", objectListHolder.value);
assertEquals("Unexpected number of resources", 3, objectListHolder.value.getObject().size());
for (ObjectType object : objectListHolder.value.getObject()) {
// Marshalling may fail even though the Java object is OK so test for it
String xml = prismContext.serializeObjectToString(object.asPrismObject(), PrismContext.LANG_XML);
}
}
use of javax.xml.ws.Holder 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 javax.xml.ws.Holder in project midpoint by Evolveum.
the class TestWSSanity method test015SearchLdapConnector.
// TODO: fetch&parse schema http://..?WSDL
@Test
public void test015SearchLdapConnector() throws Exception {
final String TEST_NAME = "test015SearchLdapConnector";
displayTestTitle(TEST_NAME);
QueryType query = new QueryType();
query.setFilter(ModelClientUtil.parseSearchFilterType("<equal xmlns='http://prism.evolveum.com/xml/ns/public/query-3' xmlns:c='http://midpoint.evolveum.com/xml/ns/public/common/common-3' >" + "<path>c:connectorType</path>" + "<value>" + CONNECTOR_LDAP_TYPE + "</value>" + "</equal>"));
Holder<ObjectListType> objectListHolder = new Holder<>();
Holder<OperationResultType> resultHolder = new Holder<>();
// WHEN
modelPort.searchObjects(ModelClientUtil.getTypeQName(ConnectorType.class), query, null, objectListHolder, resultHolder);
// THEN
assertSuccess(resultHolder);
ObjectListType objectList = objectListHolder.value;
assertEquals("Unexpected number of LDAP connectors", 1, objectList.getObject().size());
ConnectorType ldapConnector = (ConnectorType) objectList.getObject().get(0);
assertNotNull("Null LDAP connector", ldapConnector);
connectorLdapOid = ldapConnector.getOid();
assertNotNull("Null LDAP connector OID", connectorLdapOid);
}
use of javax.xml.ws.Holder 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 javax.xml.ws.Holder 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");
}
Aggregations