use of com.evolveum.midpoint.schema.processor.ResourceObjectClassDefinition in project midpoint by Evolveum.
the class TestEntitlements method getGroupShadow.
private PrismObject<ShadowType> getGroupShadow(DummyResourceContoller dummyResourceCtl, QName objectClass, String name, Task task, OperationResult result) throws Exception {
PrismObject<ResourceType> resource = dummyResourceCtl.getResource();
ResourceObjectClassDefinition groupDef = ResourceSchemaFactory.getCompleteSchema(resource).findObjectClassDefinition(dummyResourceCtl.getGroupObjectClass());
ResourceAttributeDefinition<?> nameDef = groupDef.findAttributeDefinition(SchemaConstants.ICFS_NAME);
assertNotNull("No icfs:name definition", nameDef);
ObjectQuery query = ObjectQueryUtil.createResourceAndObjectClassFilterPrefix(resource.getOid(), objectClass, prismContext).and().item(ItemPath.create(ShadowType.F_ATTRIBUTES, SchemaConstants.ICFS_NAME), nameDef).eq(name).build();
SearchResultList<PrismObject<ShadowType>> shadows = modelService.searchObjects(ShadowType.class, query, null, task, result);
assertEquals("Wrong # of results for " + name + " of " + objectClass + " at " + resource, 1, shadows.size());
return shadows.get(0);
}
Aggregations