From ac8c396b34925337df3484f44d4141c1acb565f5 Mon Sep 17 00:00:00 2001 From: Pawel Rainer Date: Fri, 13 Oct 2023 18:36:52 +0200 Subject: [PATCH] add test --- .../NodeWithCategoryIndexingTests.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodeWithCategoryIndexingTests.java b/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodeWithCategoryIndexingTests.java index b592db3817..19be61c0f6 100644 --- a/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodeWithCategoryIndexingTests.java +++ b/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodeWithCategoryIndexingTests.java @@ -86,4 +86,30 @@ public void testParentQueryAgainstFolderAfterCategoryDeletion() STEP("Verify that searching by PARENT and deleted category will find no descendant nodes."); searchQueryService.expectResultsFromQuery(query, testUser); } + + @Test(groups = TestGroup.SEARCH) + public void testParentQueryAgainstFolderAfterParentCategoryDeletion() + { + // given + STEP("Create nested folders in site's Document Library."); + folders().createNestedFolders(C); + + STEP("Create nested categories."); + categories.createNestedCategories(P, Q); + + STEP("Link folders to category."); + folders(C).linkToCategory(categories.get(Q)); + + // when + STEP("Verify that searching by PARENT and category will find one descendant node: folderC."); + SearchRequest query = req("PARENT:" + categories.get(Q).getId()); + searchQueryService.expectResultsFromQuery(query, testUser, folders(C).getName()); + + // then + STEP("Delete categoryM."); + categories.delete(P); + + STEP("Verify that searching by PARENT and deleted category will find no descendant nodes."); + searchQueryService.expectResultsFromQuery(query, testUser); + } }