Changes per the review comments

This commit is contained in:
meenal.bhave@alfresco.com
2019-09-19 16:26:53 +01:00
parent 9a9dc1d4e2
commit 270eb6b88a
2 changed files with 10 additions and 15 deletions

View File

@@ -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);

View File

@@ -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");