Merged 5.2.N (5.2.1) to HEAD (5.2)

127160 cturlica: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
      127134 cturlica: Merged 5.0.N (5.0.4) to 5.1.N (5.1.2)
         127102 rmunteanu: MNT-15614 : Site with name "IT" cannot be managed properly
            - Changed the way the role name is striped out.
            - Implemented tests.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127868 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-06-06 09:21:06 +00:00
parent 3bf3914916
commit db287e9c24
3 changed files with 64 additions and 5 deletions

View File

@@ -40,6 +40,7 @@ import javax.mail.internet.MimeMessage;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.action.executer.MailActionExecuter;
import org.alfresco.repo.management.subsystems.ApplicationContextFactory;
import org.alfresco.repo.processor.TemplateServiceImpl;
import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.site.SiteModel;
@@ -51,9 +52,7 @@ import org.alfresco.service.cmr.invitation.InvitationService;
import org.alfresco.service.cmr.invitation.ModeratedInvitation;
import org.alfresco.service.cmr.invitation.NominatedInvitation;
import org.alfresco.service.cmr.repository.TemplateService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.cmr.security.PersonService.PersonInfo;
import org.alfresco.service.cmr.site.SiteInfo;
import org.alfresco.service.cmr.site.SiteService;
import org.alfresco.service.cmr.site.SiteVisibility;
@@ -62,7 +61,6 @@ import org.alfresco.util.PropertyMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.util.ReflectionUtils;
import org.alfresco.repo.processor.TemplateServiceImpl;
/**
* Unit tests of Invitation Service
@@ -661,6 +659,39 @@ public abstract class AbstractInvitationServiceImplTest extends BaseAlfrescoSpri
}
}
/**
* MNT-15614 Site with name "IT" cannot be managed properly
*
* @throws Exception
*/
public void test_MNT15614() throws Exception
{
String[] siteNames = {"it", "site", "GROUP"};
String inviteeUserName = USER_ONE;
Invitation.ResourceType resourceType = Invitation.ResourceType.WEB_SITE;
String inviteeRole = SiteModel.SITE_COLLABORATOR;
String acceptUrl = "froob";
String rejectUrl = "marshmallow";
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
for (String siteName : siteNames)
{
SiteInfo siteInfoRed = siteService.getSite(siteName);
if (siteInfoRed == null)
{
siteService.createSite("InviteSitePreset", siteName, "InviteSiteTitle",
"InviteSiteDescription", SiteVisibility.MODERATED);
}
// Invite user
NominatedInvitation nominatedInvitation = invitationService.inviteNominated(
inviteeUserName, resourceType, siteName, inviteeRole, acceptUrl, rejectUrl);
assertNotNull("nominated invitation is null", nominatedInvitation);
}
}
/**
* Test nominated user - new user with whitespace in name. Related to
* ETHREEOH-3030.