diff --git a/repo/repo-sqale/src/test/java/com/evolveum/midpoint/repo/sqale/func/SqaleRepoSearchTest.java b/repo/repo-sqale/src/test/java/com/evolveum/midpoint/repo/sqale/func/SqaleRepoSearchTest.java index 3922fea658d..02392542d4d 100644 --- a/repo/repo-sqale/src/test/java/com/evolveum/midpoint/repo/sqale/func/SqaleRepoSearchTest.java +++ b/repo/repo-sqale/src/test/java/com/evolveum/midpoint/repo/sqale/func/SqaleRepoSearchTest.java @@ -417,12 +417,26 @@ public void test110SearchUserByName() throws Exception { * * String value is normalized as configured for norm matching (as demonstrated in this test). */ @Test - public void test110SearchUserByNameNormalized() throws Exception { + public void test111SearchUserByNameNormalized() throws Exception { searchUsersTest("with normalized name matching provided value", f -> f.item(UserType.F_NAME).eq("UseR--2").matchingNorm(), user2Oid); } + /** + * Multi-value EQ filter (multiple values on the right-hand side) works like `IN`, + * that is if any of the values matches, the object matches and is returned. + */ + @Test + public void test115SearchUserByAnyOfName() throws Exception { + searchUsersTest("with name matching any of provided values (multi-value EQ filter)", + f -> f.item(UserType.F_NAME).eq( + PolyString.fromOrig("user-1"), + PolyString.fromOrig("user-2"), + PolyString.fromOrig("user-wrong")), // bad value is of no consequence + user1Oid, user2Oid); + } + @Test public void test120SearchObjectsBySubtype() throws Exception { searchObjectTest("having subtype equal to value", ObjectType.class, @@ -1737,9 +1751,10 @@ public void test800SearchUsersWithSimplePath() throws SchemaException { @Test(expectedExceptions = SystemException.class) public void test820SearchUsersWithReferencedPath() throws SchemaException { searchUsersTest("fullName does not equals fname", - f -> f.not().item(ObjectType.F_METADATA, MetadataType.F_CREATE_TIMESTAMP).eq().item(UserType.F_ASSIGNMENT, AssignmentType.F_METADATA, MetadataType.F_CREATE_TIMESTAMP), + f -> f.not().item(ObjectType.F_METADATA, MetadataType.F_CREATE_TIMESTAMP) + .eq().item(UserType.F_ASSIGNMENT, AssignmentType.F_METADATA, MetadataType.F_CREATE_TIMESTAMP), user1Oid, user2Oid, user3Oid, user4Oid); - // Should fail because right hand side nesting into multivalue container is not supported + // Should fail because right-hand side nesting into multivalue container is not supported } // region special cases