diff --git a/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/dao/repo/PlainSchemaRepoExtImpl.java b/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/dao/repo/PlainSchemaRepoExtImpl.java index 39ddca4f30..1801040b9c 100644 --- a/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/dao/repo/PlainSchemaRepoExtImpl.java +++ b/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/dao/repo/PlainSchemaRepoExtImpl.java @@ -93,11 +93,11 @@ public List findByAnyTypeClasses(final Collection> boolean hasAttrs(final PlainSchema schema, final Class reference) { String label; - if (reference.isAssignableFrom(GPlainAttr.class)) { + if (GPlainAttr.class.isAssignableFrom(reference)) { label = Neo4jGroup.NODE; - } else if (reference.isAssignableFrom(APlainAttr.class)) { + } else if (APlainAttr.class.isAssignableFrom(reference)) { label = Neo4jAnyObject.NODE; - } else if (reference.isAssignableFrom(LAPlainAttr.class)) { + } else if (LAPlainAttr.class.isAssignableFrom(reference)) { label = Neo4jLinkedAccount.NODE; } else { label = Neo4jUser.NODE; diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SearchITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SearchITCase.java index ae102c7964..13b4a8fcd0 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SearchITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SearchITCase.java @@ -796,6 +796,14 @@ public void issueSYNCOPE1419() { assertNotNull(rossini); assertEquals("2009-05-26", rossini.getPlainAttr("loginDate").orElseThrow().getValues().get(0)); + if (IS_EXT_SEARCH_ENABLED) { + try { + Thread.sleep(2000); + } catch (InterruptedException ex) { + // ignore + } + } + PagedResult total = USER_SERVICE.search( new AnyQuery.Builder().realm(SyncopeConstants.ROOT_REALM).page(1).size(1).build()); @@ -1028,14 +1036,14 @@ void issueSYNCOPE1826() { // ignore } } - + try { assertFalse(USER_SERVICE.search(new AnyQuery.Builder().realm(SyncopeConstants.ROOT_REALM).details(false) .fiql(SyncopeClient.getUserSearchConditionBuilder().is("username") .equalToIgnoreCase("user test 1826").query()).build()).getResult().isEmpty()); assertFalse(ANY_OBJECT_SERVICE.search(new AnyQuery.Builder().realm(SyncopeConstants.ROOT_REALM) .details(false).fiql(SyncopeClient.getAnyObjectSearchConditionBuilder(PRINTER).is("name") - .equalToIgnoreCase("obj test 1826").query()).build()).getResult().isEmpty()); + .equalToIgnoreCase("obj test 1826").query()).build()).getResult().isEmpty()); assertFalse(USER_SERVICE.search(new AnyQuery.Builder().realm(SyncopeConstants.ROOT_REALM).details(false) .fiql(SyncopeClient.getUserSearchConditionBuilder().is("username") .equalToIgnoreCase("user 1826 test").query()).build()).getResult().isEmpty()); @@ -1049,5 +1057,5 @@ void issueSYNCOPE1826() { deleteUser("user test 182"); } } - + }