REPO-3280: refactor test authenticate as admit for "type":"cm:dictionaryModel"

This commit is contained in:
Andreea Nechifor
2018-04-05 11:14:45 +03:00
parent a1a5fc9026
commit 4ade4ddb20
3 changed files with 5 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ import org.alfresco.opencmis.search.CMISQueryService;
import org.alfresco.repo.dictionary.DictionaryDAO;
import org.alfresco.repo.dictionary.NamespaceDAO;
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.permissions.impl.ModelDAO;
import org.alfresco.service.ServiceRegistry;
@@ -156,7 +157,8 @@ public abstract class BaseCMISTest extends TestCase
testTX = transactionService.getUserTransaction();
testTX.begin();
this.authenticationComponent.setSystemUserAsCurrentUser();
// Authenticate as the admin user
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
String storeName = "CMISTest-" + getStoreName() + "-" + (new Date().getTime());
this.storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, storeName);

View File

@@ -394,7 +394,7 @@ public class DictionaryModelTypeTest extends BaseSpringTest
this.actionService = (ActionService)this.applicationContext.getBean("actionService");
this.transactionService = (TransactionService)this.applicationContext.getBean("transactionComponent");
// Authenticate as the system user
// Authenticate as the admin user
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());

View File

@@ -132,7 +132,7 @@ public class UserUsageTest extends TestCase
testTX = transactionService.getUserTransaction();
testTX.begin();
this.authenticationComponent.setSystemUserAsCurrentUser();
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
// get default store (as configured for content usage service)
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");