use of com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCaseType.F_WORK_ITEM in project midpoint by Evolveum.
the class QueryInterpreter2Test method test920DecisionsNotAnswered.
@Test
public void test920DecisionsNotAnswered() throws Exception {
Session session = open();
try {
/*
* ### AccCertCase: Exists (decision: assigneeRef = XYZ and stage = ../stage and response is null or response = NO_RESPONSE)
*/
ObjectQuery query = QueryBuilder.queryFor(AccessCertificationCaseType.class, prismContext).exists(F_WORK_ITEM).block().item(F_ASSIGNEE_REF).ref("123456").and().item(F_STAGE_NUMBER).eq().item(T_PARENT, AccessCertificationCaseType.F_STAGE_NUMBER).and().item(F_OUTPUT, AbstractWorkItemOutputType.F_OUTCOME).isNull().endBlock().build();
String real = getInterpretedQuery2(session, AccessCertificationCaseType.class, query);
String expected = "select\n" + " a.ownerOid, a.id, a.fullObject\n" + "from\n" + " RAccessCertificationCase a\n" + " left join a.workItems w\n" + " left join w.assigneeRef a2\n" + "where\n" + " (\n" + " (\n" + " a2.targetOid = :targetOid and\n" + " a2.relation in (:relation)\n" + " ) and\n" + " (\n" + " w.stageNumber = a.stageNumber or\n" + " (\n" + " w.stageNumber is null and\n" + " a.stageNumber is null\n" + " )\n" + " ) and\n" + " w.outcome is null\n" + " )\n";
assertEqualsIgnoreWhitespace(expected, real);
} finally {
close(session);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCaseType.F_WORK_ITEM in project midpoint by Evolveum.
the class QueryInterpreter2Test method test745QueryCertCaseReviewerAndEnabledByDeadlineAndOidAsc.
@Test
public void test745QueryCertCaseReviewerAndEnabledByDeadlineAndOidAsc() throws Exception {
Session session = open();
try {
PrismReferenceValue assigneeRef = ObjectTypeUtil.createObjectRef("1234567890", ObjectTypes.USER).asReferenceValue();
ObjectQuery query = QueryBuilder.queryFor(AccessCertificationCaseType.class, prismContext).item(F_WORK_ITEM, F_ASSIGNEE_REF).ref(assigneeRef).and().item(AccessCertificationCaseType.F_STAGE_NUMBER).eq().item(T_PARENT, AccessCertificationCampaignType.F_STAGE_NUMBER).asc(F_CURRENT_STAGE_DEADLINE).asc(T_ID).build();
String real = getInterpretedQuery2(session, AccessCertificationCaseType.class, query, false);
String expected = "select\n" + " a.ownerOid, a.id, a.fullObject\n" + "from\n" + " RAccessCertificationCase a\n" + " left join a.workItems w\n" + " left join w.assigneeRef a2\n" + " left join a.owner o\n" + "where\n" + " (\n" + " (\n" + " a2.targetOid = :targetOid and\n" + " a2.relation in (:relation) and\n" + " a2.type = :type\n" + " ) and\n" + " (\n" + " a.stageNumber = o.stageNumber or\n" + " (\n" + " a.stageNumber is null and\n" + " o.stageNumber is null\n" + " )\n" + " )\n" + " )\n" + "order by a.reviewDeadline asc, a.id asc\n";
assertEqualsIgnoreWhitespace(expected, real);
} finally {
close(session);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCaseType.F_WORK_ITEM in project midpoint by Evolveum.
the class QueryInterpreter2Test method test730QueryCertCaseReviewer.
@Test
public void test730QueryCertCaseReviewer() throws Exception {
Session session = open();
try {
ObjectQuery query = QueryBuilder.queryFor(AccessCertificationCaseType.class, prismContext).item(F_WORK_ITEM, F_ASSIGNEE_REF).ref("1234567890").build();
String real = getInterpretedQuery2(session, AccessCertificationCaseType.class, query, false);
String expected = "select\n" + " a.ownerOid, a.id, a.fullObject\n" + "from\n" + " RAccessCertificationCase a\n" + " left join a.workItems w\n" + " left join w.assigneeRef a2\n" + "where\n" + " (\n" + " a2.targetOid = :targetOid and\n" + " a2.relation in (:relation)\n" + " )\n";
assertEqualsIgnoreWhitespace(expected, real);
} finally {
close(session);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCaseType.F_WORK_ITEM in project midpoint by Evolveum.
the class QueryInterpreter2Test method test735QueryCertCaseReviewerAndEnabled.
@Test
public void test735QueryCertCaseReviewerAndEnabled() throws Exception {
Session session = open();
try {
PrismReferenceValue assigneeRef = ObjectTypeUtil.createObjectRef("1234567890", ObjectTypes.USER).asReferenceValue();
ObjectQuery query = QueryBuilder.queryFor(AccessCertificationCaseType.class, prismContext).item(F_WORK_ITEM, F_ASSIGNEE_REF).ref(assigneeRef).and().item(AccessCertificationCaseType.F_STAGE_NUMBER).eq().item(T_PARENT, AccessCertificationCampaignType.F_STAGE_NUMBER).build();
String real = getInterpretedQuery2(session, AccessCertificationCaseType.class, query, false);
String expected = "select\n" + " a.ownerOid, a.id, a.fullObject\n" + "from\n" + " RAccessCertificationCase a\n" + " left join a.workItems w\n" + " left join w.assigneeRef a2\n" + " left join a.owner o\n" + "where\n" + " (\n" + " (\n" + " a2.targetOid = :targetOid and\n" + " a2.relation in (:relation) and\n" + " a2.type = :type\n" + " ) and\n" + " (\n" + " a.stageNumber = o.stageNumber or\n" + " (\n" + " a.stageNumber is null and\n" + " o.stageNumber is null\n" + " )\n" + " )\n" + " )\n";
assertEqualsIgnoreWhitespace(expected, real);
} finally {
close(session);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCaseType.F_WORK_ITEM in project midpoint by Evolveum.
the class QueryInterpreterTest method test234QueryCertCaseReviewerAndEnabledByRequestedDesc.
@Test
public void test234QueryCertCaseReviewerAndEnabledByRequestedDesc() throws Exception {
Session session = open();
try {
PrismReferenceValue assigneeRef = ObjectTypeUtil.createObjectRef("1234567890", ObjectTypes.USER).asReferenceValue();
ObjectQuery query = prismContext.queryFor(AccessCertificationCaseType.class).item(F_WORK_ITEM, F_ASSIGNEE_REF).ref(assigneeRef).and().item(AccessCertificationCaseType.F_STAGE_NUMBER).eq().item(T_PARENT, AccessCertificationCampaignType.F_STAGE_NUMBER).and().item(T_PARENT, F_STATE).eq(IN_REVIEW_STAGE).desc(F_CURRENT_STAGE_CREATE_TIMESTAMP).build();
String real = getInterpretedQuery(session, AccessCertificationCaseType.class, query, false);
assertThat(real).isEqualToIgnoringWhitespace("select\n" + " a.ownerOid, a.id, a.fullObject\n" + "from\n" + " RAccessCertificationCase a\n" + " left join a.workItems w\n" + " left join w.assigneeRef a2\n" + " left join a.owner o\n" + "where\n" + " (\n" + " (\n" + " a2.targetOid = :targetOid and\n" + " a2.relation in (:relation) and\n" + " a2.targetType = :targetType\n" + " ) and\n" + " (\n" + " a.stageNumber = o.stageNumber or\n" + " (\n" + " a.stageNumber is null and\n" + " o.stageNumber is null\n" + " )\n" + " ) and\n" + " o.state = :state\n" + " )\n" + "order by a.reviewRequestedTimestamp desc");
} finally {
close(session);
}
}
Aggregations