Skip to content

Commit

Permalink
SqaleRepoSearchTest.java: one more test showing NOT with implicit EXISTS
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Sep 17, 2021
1 parent 6ee53bd commit a605a62
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ public void test321QueryWithExistsFilterAndNotInside() throws SchemaException {

@Test
public void test322QueryWithNotExistsFilter() throws SchemaException {
// this one is the actual inverse of test320
// This one is the actual inverse of test320, demonstrates MID-7203.
searchUsersTest("matching the not exists assignment with specific lifecycle",
f -> f.not()
.exists(UserType.F_ASSIGNMENT)
Expand All @@ -900,6 +900,17 @@ public void test322QueryWithNotExistsFilter() throws SchemaException {
user2Oid, user3Oid, user4Oid, creatorOid, modifierOid);
}

@Test
public void test323NotBeforeMultiValueContainerImpliesExists() throws SchemaException {
// This works just like above, because path traversal via multi-value container (assignment)
// implies EXISTS which appears just after NOT. So "NOT + multi-value container => none of ...".
// For readability, it's better to make EXISTS explicit, so it's not interpreted as EXISTS (NOT ...).
searchUsersTest("matching the not exists assignment with specific lifecycle",
f -> f.not()
.item(UserType.F_ASSIGNMENT, AssignmentType.F_LIFECYCLE_STATE).eq("assignment1-1"),
user2Oid, user3Oid, user4Oid, creatorOid, modifierOid);
}

@Test
public void test325AndFilterVersusExistsAndFilter() throws SchemaException {
searchUsersTest("matching the AND filter for assignment (across multiple assignments)",
Expand Down

0 comments on commit a605a62

Please sign in to comment.