From 270eb6b88a847ad521b8c68b1c8c4c82d30c494c Mon Sep 17 00:00:00 2001 From: "meenal.bhave@alfresco.com" Date: Thu, 19 Sep 2019 16:26:53 +0100 Subject: [PATCH] Changes per the review comments --- .../functional/gs/AbstractGSE2ETest.java | 18 ++++++------------ .../functional/gs/sql/SearchSqlGSE2ETest.java | 7 ++++--- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/gs/AbstractGSE2ETest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/gs/AbstractGSE2ETest.java index 35362d0c6..497f700af 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/gs/AbstractGSE2ETest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/gs/AbstractGSE2ETest.java @@ -7,7 +7,6 @@ package org.alfresco.test.search.functional.gs; -import static lombok.AccessLevel.PROTECTED; import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordCategoryChildModel; import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordCategoryModel; import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric; @@ -33,8 +32,6 @@ import org.springframework.http.HttpStatus; import org.testng.Assert; import org.testng.annotations.BeforeClass; -import lombok.Getter; - /** * Base test class for GS tests. * @@ -62,15 +59,9 @@ public abstract class AbstractGSE2ETest extends AbstractInsightEngineE2ETest protected static final String SEARCH_LANGUAGE_CMIS = "cmis"; - // Classification levels - public String TOP_SECRET_CLASSIFICATION_LEVEL_ID = "TS"; - public String SECRET_CLASSIFICATION_LEVEL_ID = "S"; - public String CONFIDENTIAL_CLASSIFICATION_LEVEL_ID = "C"; - public String UNCLASSIFIED_CLASSIFICATION_LEVEL_ID = "U"; @Autowired - @Getter (value = PROTECTED) - private RestAPIFactory restAPIFactory; + protected RestAPIFactory restAPIFactory; @Autowired private ClassificationService classificationService; @@ -142,6 +133,10 @@ public abstract class AbstractGSE2ETest extends AbstractInsightEngineE2ETest return user; } + protected RestAPIFactory getRestAPIFactory() + { + return restAPIFactory; + } /** * Helper method to create root category as the admin user * @@ -149,7 +144,7 @@ public abstract class AbstractGSE2ETest extends AbstractInsightEngineE2ETest * @return The created category * @throws Exception on unsuccessful component creation */ - public RecordCategory createRootCategory(String categoryName) throws Exception + public RecordCategory createRootCategory(String categoryName) { return createRootCategory(adminUserModel, categoryName, RECORD_CATEGORY_TITLE); } @@ -164,7 +159,6 @@ public abstract class AbstractGSE2ETest extends AbstractInsightEngineE2ETest * @throws Exception on unsuccessful component creation */ public RecordCategory createRootCategory(UserModel userModel, String categoryName, String categoryTitle) - throws Exception { RecordCategory recordCategoryModel = createRecordCategoryModel(categoryName, categoryTitle); return restAPIFactory.getFilePlansAPI(userModel).createRootRecordCategory(recordCategoryModel, FILE_PLAN_ALIAS); diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/gs/sql/SearchSqlGSE2ETest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/gs/sql/SearchSqlGSE2ETest.java index 2840cc3e2..45fdbea49 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/gs/sql/SearchSqlGSE2ETest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/gs/sql/SearchSqlGSE2ETest.java @@ -11,6 +11,7 @@ import static org.alfresco.rest.rm.community.model.user.UserRoles.ROLE_RM_USER; import org.alfresco.rest.core.RestResponse; import org.alfresco.rest.rm.community.model.record.Record; import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild; +import org.alfresco.rest.rm.enterprise.core.ClassificationData; import org.alfresco.rest.search.SearchSqlRequest; import org.alfresco.search.TestGroup; import org.alfresco.test.search.functional.gs.AbstractGSE2ETest; @@ -52,9 +53,9 @@ public class SearchSqlGSE2ETest extends AbstractGSE2ETest testUserNoAccess = dataUser.createRandomTestUser("UserSearchNoAccess"); // Create classified files - fileClassifiedAsTopSecret = createClassifiedFile(TOP_SECRET_CLASSIFICATION_LEVEL_ID); - fileClassifiedAsSecret = createClassifiedFile(SECRET_CLASSIFICATION_LEVEL_ID); - fileClassifiedAsConfidential = createClassifiedFile(CONFIDENTIAL_CLASSIFICATION_LEVEL_ID); + fileClassifiedAsTopSecret = createClassifiedFile(ClassificationData.TOP_SECRET_CLASSIFICATION_LEVEL_ID); + fileClassifiedAsSecret = createClassifiedFile(ClassificationData.SECRET_CLASSIFICATION_LEVEL_ID); + fileClassifiedAsConfidential = createClassifiedFile(ClassificationData.CONFIDENTIAL_CLASSIFICATION_LEVEL_ID); // Create unclassified file fileUnclassified = new FileModel(unique_searchString + "Unclassified-1.txt", "Unclassified1", "Unclassified1", FileType.TEXT_PLAIN, "Unclassified1");