mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
REPO-3280: refactor test authenticate as admit for "type":"cm:dictionaryModel"
This commit is contained in:
@@ -36,6 +36,7 @@ import org.alfresco.opencmis.search.CMISQueryService;
|
|||||||
import org.alfresco.repo.dictionary.DictionaryDAO;
|
import org.alfresco.repo.dictionary.DictionaryDAO;
|
||||||
import org.alfresco.repo.dictionary.NamespaceDAO;
|
import org.alfresco.repo.dictionary.NamespaceDAO;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||||
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.security.authentication.MutableAuthenticationDao;
|
import org.alfresco.repo.security.authentication.MutableAuthenticationDao;
|
||||||
import org.alfresco.repo.security.permissions.impl.ModelDAO;
|
import org.alfresco.repo.security.permissions.impl.ModelDAO;
|
||||||
import org.alfresco.service.ServiceRegistry;
|
import org.alfresco.service.ServiceRegistry;
|
||||||
@@ -156,7 +157,8 @@ public abstract class BaseCMISTest extends TestCase
|
|||||||
|
|
||||||
testTX = transactionService.getUserTransaction();
|
testTX = transactionService.getUserTransaction();
|
||||||
testTX.begin();
|
testTX.begin();
|
||||||
this.authenticationComponent.setSystemUserAsCurrentUser();
|
// Authenticate as the admin user
|
||||||
|
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
||||||
|
|
||||||
String storeName = "CMISTest-" + getStoreName() + "-" + (new Date().getTime());
|
String storeName = "CMISTest-" + getStoreName() + "-" + (new Date().getTime());
|
||||||
this.storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, storeName);
|
this.storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, storeName);
|
||||||
|
@@ -394,7 +394,7 @@ public class DictionaryModelTypeTest extends BaseSpringTest
|
|||||||
this.actionService = (ActionService)this.applicationContext.getBean("actionService");
|
this.actionService = (ActionService)this.applicationContext.getBean("actionService");
|
||||||
this.transactionService = (TransactionService)this.applicationContext.getBean("transactionComponent");
|
this.transactionService = (TransactionService)this.applicationContext.getBean("transactionComponent");
|
||||||
|
|
||||||
// Authenticate as the system user
|
// Authenticate as the admin user
|
||||||
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
||||||
|
|
||||||
|
|
||||||
|
@@ -132,7 +132,7 @@ public class UserUsageTest extends TestCase
|
|||||||
|
|
||||||
testTX = transactionService.getUserTransaction();
|
testTX = transactionService.getUserTransaction();
|
||||||
testTX.begin();
|
testTX.begin();
|
||||||
this.authenticationComponent.setSystemUserAsCurrentUser();
|
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
||||||
|
|
||||||
// get default store (as configured for content usage service)
|
// get default store (as configured for content usage service)
|
||||||
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
|
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
|
||||||
|
Reference in New Issue
Block a user