Search in sources :

Example 1 with S_FilterExit

use of com.evolveum.midpoint.prism.query.builder.S_FilterExit in project midpoint by Evolveum.

the class SqaleRepoBaseTest method searchObjectTest.

protected <T extends ObjectType> SearchResultList<T> searchObjectTest(String description, Class<T> type, Function<S_FilterEntryOrEmpty, S_FilterExit> filter, String... expectedOids) throws SchemaException {
    String typeName = type.getSimpleName().replaceAll("Type$", "").toLowerCase();
    when("searching for " + typeName + "(s) " + description);
    OperationResult operationResult = createOperationResult();
    SearchResultList<T> result = searchObjects(type, filter.apply(prismContext.queryFor(type)).build(), operationResult);
    then(typeName + "(s) " + description + " are returned");
    assertThatOperationResult(operationResult).isSuccess();
    assertThat(result).extracting(o -> o.getOid()).containsExactlyInAnyOrder(expectedOids);
    return result;
}
Also used : FlexibleRelationalPathBase(com.evolveum.midpoint.repo.sqlbase.querydsl.FlexibleRelationalPathBase) com.evolveum.midpoint.schema(com.evolveum.midpoint.schema) java.util(java.util) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) SqaleAuditService(com.evolveum.midpoint.repo.sqale.audit.SqaleAuditService) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) JdbcSession(com.evolveum.midpoint.repo.sqlbase.JdbcSession) SchemaConstants(com.evolveum.midpoint.schema.constants.SchemaConstants) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Autowired(org.springframework.beans.factory.annotation.Autowired) OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) Function(java.util.function.Function) ObjectFilter(com.evolveum.midpoint.prism.query.ObjectFilter) QNameUtil(com.evolveum.midpoint.util.QNameUtil) SqlRecorder(com.evolveum.midpoint.repo.sqlbase.querydsl.SqlRecorder) QUri(com.evolveum.midpoint.repo.sqale.qmodel.common.QUri) MExtItem(com.evolveum.midpoint.repo.sqale.qmodel.ext.MExtItem) QExtItem(com.evolveum.midpoint.repo.sqale.qmodel.ext.QExtItem) ShadowAttributesType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowAttributesType) MReference(com.evolveum.midpoint.repo.sqale.qmodel.ref.MReference) MExtItemHolderType(com.evolveum.midpoint.repo.sqale.qmodel.ext.MExtItemHolderType) MObjectType(com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType) SQLQuery(com.querydsl.sql.SQLQuery) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) QueryType(com.evolveum.prism.xml.ns._public.query_3.QueryType) AuditService(com.evolveum.midpoint.audit.api.AuditService) QObject(com.evolveum.midpoint.repo.sqale.qmodel.object.QObject) AbstractSpringTest(com.evolveum.midpoint.test.util.AbstractSpringTest) BeforeClass(org.testng.annotations.BeforeClass) SqlPerformanceMonitorImpl(com.evolveum.midpoint.repo.sqlbase.perfmon.SqlPerformanceMonitorImpl) StandardCharsets(java.nio.charset.StandardCharsets) InfraTestMixin(com.evolveum.midpoint.test.util.InfraTestMixin) Nullable(org.jetbrains.annotations.Nullable) Stream(java.util.stream.Stream) ItemName(com.evolveum.midpoint.prism.path.ItemName) ContextConfiguration(org.springframework.test.context.ContextConfiguration) MObject(com.evolveum.midpoint.repo.sqale.qmodel.object.MObject) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) QName(javax.xml.namespace.QName) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) S_FilterExit(com.evolveum.midpoint.prism.query.builder.S_FilterExit) Predicate(com.querydsl.core.types.Predicate) NotNull(org.jetbrains.annotations.NotNull) S_FilterEntryOrEmpty(com.evolveum.midpoint.prism.query.builder.S_FilterEntryOrEmpty) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Aggregations

AuditService (com.evolveum.midpoint.audit.api.AuditService)1 com.evolveum.midpoint.prism (com.evolveum.midpoint.prism)1 ItemName (com.evolveum.midpoint.prism.path.ItemName)1 ObjectFilter (com.evolveum.midpoint.prism.query.ObjectFilter)1 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)1 S_FilterEntryOrEmpty (com.evolveum.midpoint.prism.query.builder.S_FilterEntryOrEmpty)1 S_FilterExit (com.evolveum.midpoint.prism.query.builder.S_FilterExit)1 OperationPerformanceInformation (com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation)1 SqaleAuditService (com.evolveum.midpoint.repo.sqale.audit.SqaleAuditService)1 QUri (com.evolveum.midpoint.repo.sqale.qmodel.common.QUri)1 MExtItem (com.evolveum.midpoint.repo.sqale.qmodel.ext.MExtItem)1 MExtItemHolderType (com.evolveum.midpoint.repo.sqale.qmodel.ext.MExtItemHolderType)1 QExtItem (com.evolveum.midpoint.repo.sqale.qmodel.ext.QExtItem)1 MObject (com.evolveum.midpoint.repo.sqale.qmodel.object.MObject)1 MObjectType (com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType)1 QObject (com.evolveum.midpoint.repo.sqale.qmodel.object.QObject)1 MReference (com.evolveum.midpoint.repo.sqale.qmodel.ref.MReference)1 JdbcSession (com.evolveum.midpoint.repo.sqlbase.JdbcSession)1 SqlPerformanceMonitorImpl (com.evolveum.midpoint.repo.sqlbase.perfmon.SqlPerformanceMonitorImpl)1 FlexibleRelationalPathBase (com.evolveum.midpoint.repo.sqlbase.querydsl.FlexibleRelationalPathBase)1