From 96e3b8d1b206e9a08139abd35bb2adb68e5ea969 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Fri, 16 Feb 2018 11:10:17 +0000 Subject: [PATCH] RM-6080 Use system user to handle metadata node. This allows an rm admin user to classify record folders and their children. --- .../test/util/MockAuthenticationUtilHelper.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/test/util/MockAuthenticationUtilHelper.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/test/util/MockAuthenticationUtilHelper.java index dda3341c6f..7e7d5e83d4 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/test/util/MockAuthenticationUtilHelper.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/test/util/MockAuthenticationUtilHelper.java @@ -45,6 +45,10 @@ import org.mockito.stubbing.Answer; */ public class MockAuthenticationUtilHelper { + public static final String SYSTEM_USER = "system"; + public static final String ADMIN_USER = "admin"; + public static final String GUEST_USER = "guest"; + /** * Set up a Mockito mock AuthenticationUtil so that it executes all methods assuming the user has * permissions. If the mock is asked for details about the user then it assumes the currently authenticated user is @@ -95,10 +99,10 @@ public class MockAuthenticationUtilHelper }).when(mockAuthenticationUtil). runAs(any(RunAsWork.class), anyString()); - when(mockAuthenticationUtil.getAdminUserName()).thenReturn("admin"); + when(mockAuthenticationUtil.getAdminUserName()).thenReturn(ADMIN_USER); when(mockAuthenticationUtil.getFullyAuthenticatedUser()).thenReturn(fullyAuthenticatedUser); when(mockAuthenticationUtil.getRunAsUser()).thenReturn(fullyAuthenticatedUser); - when(mockAuthenticationUtil.getSystemUserName()).thenReturn("system"); - when(mockAuthenticationUtil.getGuestUserName()).thenReturn("guest"); + when(mockAuthenticationUtil.getSystemUserName()).thenReturn(SYSTEM_USER); + when(mockAuthenticationUtil.getGuestUserName()).thenReturn(GUEST_USER); } }