From 84bcee8d5f3f3219549cf89d891172d6277a6359 Mon Sep 17 00:00:00 2001 From: Krystian Dabrowski Date: Thu, 28 Sep 2023 14:08:56 +0200 Subject: [PATCH] ACS-5471: Secondary path support - fixes for PMD --- .../NodesSecondaryAncestorIndexingTests.java | 16 ++++++++-------- .../NodesSecondaryChildrenRelatedTests.java | 3 +++ .../NodesSecondaryParentIndexingTests.java | 14 +++++++------- .../NodesSecondaryPathIndexingTests.java | 16 ++++++++-------- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryAncestorIndexingTests.java b/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryAncestorIndexingTests.java index 01ecc61dff..d5bf6aa4f1 100644 --- a/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryAncestorIndexingTests.java +++ b/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryAncestorIndexingTests.java @@ -64,7 +64,7 @@ public void dataPreparation() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryAncestor_withNodeHavingOneSecondaryChild() + public void testSecondaryAncestorWithNodeHavingOneSecondaryChild() { // then STEP("Verify that searching by ANCESTOR and folderM will find one descendant node: folderC."); @@ -74,7 +74,7 @@ public void testSecondaryAncestor_withNodeHavingOneSecondaryChild() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryAncestor_withNodeHavingTwoSecondaryChildren() + public void testSecondaryAncestorWithNodeHavingTwoSecondaryChildren() { // then STEP("Verify that searching by ANCESTOR and folderC will find nodes: ."); @@ -89,7 +89,7 @@ public void testSecondaryAncestor_withNodeHavingTwoSecondaryChildren() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryAncestor_withDocumentAsSecondaryChild() + public void testSecondaryAncestorWithDocumentAsSecondaryChild() { // then STEP("Verify that searching by ANCESTOR and folderA will find nodes: ."); @@ -103,7 +103,7 @@ public void testSecondaryAncestor_withDocumentAsSecondaryChild() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryAncestor_withNodeHavingComplexSecondaryRelationship() + public void testSecondaryAncestorWithNodeHavingComplexSecondaryRelationship() { // then STEP("Verify that all descendant of folderX can be found."); @@ -139,7 +139,7 @@ public void testSecondaryAncestor_withNodeHavingComplexSecondaryRelationship() * */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryAncestor_withDeletedSecondaryRelationship() + public void testSecondaryAncestorWithDeletedSecondaryRelationship() { // given STEP("Add to folderQ a secondary child folderR and verify if it can be found using ANCESTOR index and secondary child node reference."); @@ -181,7 +181,7 @@ public void testSecondaryAncestor_withDeletedSecondaryRelationship() * */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryAncestor_withDeletedSecondaryParentNode() + public void testSecondaryAncestorWithDeletedSecondaryParentNode() { // given STEP("Create two nested folders (D and E) in Document Library."); @@ -224,7 +224,7 @@ public void testSecondaryAncestor_withDeletedSecondaryParentNode() * will update ANCESTOR index in ES. */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryAncestor_withMovedSecondaryParentNode() + public void testSecondaryAncestorWithMovedSecondaryParentNode() { // given STEP("Create folderD inside folderQ, and add folderP to D as a secondary child."); @@ -286,7 +286,7 @@ public void testSecondaryAncestor_withMovedSecondaryParentNode() * */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryAncestor_withCopiedSecondaryParentNode() + public void testSecondaryAncestorWithCopiedSecondaryParentNode() { // given STEP("Create nested folders (G and H) inside folderS and folderT in Document Library. Make folderP a secondary child of folderG."); diff --git a/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryChildrenRelatedTests.java b/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryChildrenRelatedTests.java index 0683d8f874..4f24d93e2a 100644 --- a/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryChildrenRelatedTests.java +++ b/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryChildrenRelatedTests.java @@ -248,6 +248,7 @@ private static String getCmisLocation(Object pathMap, String name) public class TestFolders extends HashMap implements Folders { /** Creates a folder in site's Document Library. */ + @Override public Folder createFolder(String folderSuffix) { Folder createdFolder = new Folder().createNestedFolders((Folder) null, folderSuffix).get(folderSuffix); @@ -256,6 +257,7 @@ public Folder createFolder(String folderSuffix) } /** Creates multiple nested folders in site's Document Library. */ + @Override public Map createNestedFolders(String... folderSuffixes) { Map createdFolders = new Folder().createNestedFolders(null, folderSuffixes); @@ -263,6 +265,7 @@ public Map createNestedFolders(String... folderSuffixes) return createdFolders; } + @Override public void delete(Folder folder) { folder.delete(); diff --git a/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryParentIndexingTests.java b/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryParentIndexingTests.java index c12a042d3b..9c3aebb496 100644 --- a/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryParentIndexingTests.java +++ b/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryParentIndexingTests.java @@ -64,7 +64,7 @@ public void dataPreparation() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryParent_withNodeHavingOneSecondaryChild() + public void testSecondaryParentWithNodeHavingOneSecondaryChild() { // then STEP("Verify that searching rby PARENT and folderM will find node folderC."); @@ -74,7 +74,7 @@ public void testSecondaryParent_withNodeHavingOneSecondaryChild() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryParent_withNodeHavingTwoSecondaryChildren() + public void testSecondaryParentWithNodeHavingTwoSecondaryChildren() { // then STEP("Verify that searching by PARENT and folderL will find nodes: folderM, FolderC and folderY."); @@ -88,7 +88,7 @@ public void testSecondaryParent_withNodeHavingTwoSecondaryChildren() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryParent_withDocumentAsSecondaryChild() + public void testSecondaryParentWithDocumentAsSecondaryChild() { // then STEP("Verify that searching by PARENT and folderA will find nodes: folderB and file."); @@ -118,7 +118,7 @@ public void testSecondaryParent_withDocumentAsSecondaryChild() * */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryParent_withDeletedSecondaryRelationship() + public void testSecondaryParentWithDeletedSecondaryRelationship() { // given STEP("Add to folderQ a secondary child folderR and verify if it can be found using PARENT index and secondary parent node reference."); @@ -158,7 +158,7 @@ public void testSecondaryParent_withDeletedSecondaryRelationship() * */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryParent_withDeletedSecondaryParentNode() + public void testSecondaryParentWithDeletedSecondaryParentNode() { // given STEP("Create two nested folders (D and E) in Document Library."); @@ -206,7 +206,7 @@ public void testSecondaryParent_withDeletedSecondaryParentNode() * will update PARENT index in ES. */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryParent_withMovedSecondaryParentNode() + public void testSecondaryParentWithMovedSecondaryParentNode() { // given STEP("Create folderD inside folderQ, and add folderP to D as a secondary child."); @@ -269,7 +269,7 @@ public void testSecondaryParent_withMovedSecondaryParentNode() * */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryParent_withCopiedSecondaryParentNode() + public void testSecondaryParentWithCopiedSecondaryParentNode() { // given STEP("Create nested folders (G and H) inside folderS and folderT in Document Library. Make folderP a secondary child of folderG."); diff --git a/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryPathIndexingTests.java b/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryPathIndexingTests.java index 35477e7373..9b6aec1afc 100644 --- a/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryPathIndexingTests.java +++ b/tests/tas-elasticsearch/src/test/java/org/alfresco/elasticsearch/reindexing/NodesSecondaryPathIndexingTests.java @@ -64,7 +64,7 @@ public void dataPreparation() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryPath_withNodeHavingOneSecondaryChild() + public void testSecondaryPathWithNodeHavingOneSecondaryChild() { // then STEP("Verify that folderC can be found by secondary PATH using secondary parent folderM."); @@ -75,7 +75,7 @@ public void testSecondaryPath_withNodeHavingOneSecondaryChild() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryPath_withNodeHavingOnePrimaryAndTwoSecondaryChildren() + public void testSecondaryPathWithNodeHavingOnePrimaryAndTwoSecondaryChildren() { // then STEP("Verify that primary and secondary children of folderL can be found using PATH index."); @@ -91,7 +91,7 @@ public void testSecondaryPath_withNodeHavingOnePrimaryAndTwoSecondaryChildren() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryPath_withNodeHavingDocumentAsSecondaryChild() + public void testSecondaryPathWithNodeHavingDocumentAsSecondaryChild() { // then STEP("Verify that a file being a secondary child of folderA can be found using PATH index."); @@ -105,7 +105,7 @@ public void testSecondaryPath_withNodeHavingDocumentAsSecondaryChild() } @Test(groups = TestGroup.SEARCH) - public void testSecondaryPath_withNodeHavingComplexSecondaryRelationship() + public void testSecondaryPathWithNodeHavingComplexSecondaryRelationship() { // then STEP("Verify that all secondary children of folderX can be found."); @@ -141,7 +141,7 @@ public void testSecondaryPath_withNodeHavingComplexSecondaryRelationship() * */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryPath_withDeletedSecondaryRelationship() + public void testSecondaryPathWithDeletedSecondaryRelationship() { // given STEP("Add to folderQ a secondary child folderR and verify if it can be found using PATH index and secondary parent name."); @@ -181,7 +181,7 @@ public void testSecondaryPath_withDeletedSecondaryRelationship() * */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryPath_withDeletedSecondaryParentNode() + public void testSecondaryPathWithDeletedSecondaryParentNode() { // given STEP("Create two nested folders (D and E) in Document Library."); @@ -231,7 +231,7 @@ public void testSecondaryPath_withDeletedSecondaryParentNode() * will update PATH index in ES. */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryPath_withMovedSecondaryParentNode() + public void testSecondaryPathWithMovedSecondaryParentNode() { // given STEP("Create folderD inside folderQ, and add folderP as a secondary child."); @@ -303,7 +303,7 @@ public void testSecondaryPath_withMovedSecondaryParentNode() * */ @Test(groups = TestGroup.SEARCH) - public void testSecondaryParent_withCopiedSecondaryParentNode() + public void testSecondaryParentWithCopiedSecondaryParentNode() { // given STEP("Create nested folders (G and H) inside folderS and folderT in Document Library. Make folderP a secondary child of folderG.");