mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-09-17 14:21:20 +00:00
Changes per the review comments
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
package org.alfresco.test.search.functional.gs;
|
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.createRecordCategoryChildModel;
|
||||||
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordCategoryModel;
|
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordCategoryModel;
|
||||||
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
|
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
|
||||||
@@ -33,8 +32,6 @@ import org.springframework.http.HttpStatus;
|
|||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base test class for GS tests.
|
* Base test class for GS tests.
|
||||||
*
|
*
|
||||||
@@ -62,15 +59,9 @@ public abstract class AbstractGSE2ETest extends AbstractInsightEngineE2ETest
|
|||||||
|
|
||||||
protected static final String SEARCH_LANGUAGE_CMIS = "cmis";
|
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
|
@Autowired
|
||||||
@Getter (value = PROTECTED)
|
protected RestAPIFactory restAPIFactory;
|
||||||
private RestAPIFactory restAPIFactory;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ClassificationService classificationService;
|
private ClassificationService classificationService;
|
||||||
@@ -142,6 +133,10 @@ public abstract class AbstractGSE2ETest extends AbstractInsightEngineE2ETest
|
|||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected RestAPIFactory getRestAPIFactory()
|
||||||
|
{
|
||||||
|
return restAPIFactory;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Helper method to create root category as the admin user
|
* Helper method to create root category as the admin user
|
||||||
*
|
*
|
||||||
@@ -149,7 +144,7 @@ public abstract class AbstractGSE2ETest extends AbstractInsightEngineE2ETest
|
|||||||
* @return The created category
|
* @return The created category
|
||||||
* @throws Exception on unsuccessful component creation
|
* @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);
|
return createRootCategory(adminUserModel, categoryName, RECORD_CATEGORY_TITLE);
|
||||||
}
|
}
|
||||||
@@ -164,7 +159,6 @@ public abstract class AbstractGSE2ETest extends AbstractInsightEngineE2ETest
|
|||||||
* @throws Exception on unsuccessful component creation
|
* @throws Exception on unsuccessful component creation
|
||||||
*/
|
*/
|
||||||
public RecordCategory createRootCategory(UserModel userModel, String categoryName, String categoryTitle)
|
public RecordCategory createRootCategory(UserModel userModel, String categoryName, String categoryTitle)
|
||||||
throws Exception
|
|
||||||
{
|
{
|
||||||
RecordCategory recordCategoryModel = createRecordCategoryModel(categoryName, categoryTitle);
|
RecordCategory recordCategoryModel = createRecordCategoryModel(categoryName, categoryTitle);
|
||||||
return restAPIFactory.getFilePlansAPI(userModel).createRootRecordCategory(recordCategoryModel, FILE_PLAN_ALIAS);
|
return restAPIFactory.getFilePlansAPI(userModel).createRootRecordCategory(recordCategoryModel, FILE_PLAN_ALIAS);
|
||||||
|
@@ -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.core.RestResponse;
|
||||||
import org.alfresco.rest.rm.community.model.record.Record;
|
import org.alfresco.rest.rm.community.model.record.Record;
|
||||||
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
|
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.rest.search.SearchSqlRequest;
|
||||||
import org.alfresco.search.TestGroup;
|
import org.alfresco.search.TestGroup;
|
||||||
import org.alfresco.test.search.functional.gs.AbstractGSE2ETest;
|
import org.alfresco.test.search.functional.gs.AbstractGSE2ETest;
|
||||||
@@ -52,9 +53,9 @@ public class SearchSqlGSE2ETest extends AbstractGSE2ETest
|
|||||||
testUserNoAccess = dataUser.createRandomTestUser("UserSearchNoAccess");
|
testUserNoAccess = dataUser.createRandomTestUser("UserSearchNoAccess");
|
||||||
|
|
||||||
// Create classified files
|
// Create classified files
|
||||||
fileClassifiedAsTopSecret = createClassifiedFile(TOP_SECRET_CLASSIFICATION_LEVEL_ID);
|
fileClassifiedAsTopSecret = createClassifiedFile(ClassificationData.TOP_SECRET_CLASSIFICATION_LEVEL_ID);
|
||||||
fileClassifiedAsSecret = createClassifiedFile(SECRET_CLASSIFICATION_LEVEL_ID);
|
fileClassifiedAsSecret = createClassifiedFile(ClassificationData.SECRET_CLASSIFICATION_LEVEL_ID);
|
||||||
fileClassifiedAsConfidential = createClassifiedFile(CONFIDENTIAL_CLASSIFICATION_LEVEL_ID);
|
fileClassifiedAsConfidential = createClassifiedFile(ClassificationData.CONFIDENTIAL_CLASSIFICATION_LEVEL_ID);
|
||||||
|
|
||||||
// Create unclassified file
|
// Create unclassified file
|
||||||
fileUnclassified = new FileModel(unique_searchString + "Unclassified-1.txt", "Unclassified1", "Unclassified1", FileType.TEXT_PLAIN, "Unclassified1");
|
fileUnclassified = new FileModel(unique_searchString + "Unclassified-1.txt", "Unclassified1", "Unclassified1", FileType.TEXT_PLAIN, "Unclassified1");
|
||||||
|
Reference in New Issue
Block a user