mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.1.N (5.1.1) to HEAD (5.2)
122427 rneamtu: Merged 5.0.N (5.0.4) to 5.1.N (5.1.1) (PARTIAL MERGE) 122412 nsmintanca: MNT-15642 CLONE - Request to join a moderated site multiple times -added validation on backend to prevent multiple requests for joining a site -updated unit tests -added widget to display "Cancel request" button git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@123659 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -790,7 +790,9 @@ public class SiteServiceTest extends AbstractSiteServiceTest
|
|||||||
public void testInvitationSanityCheck() throws Exception
|
public void testInvitationSanityCheck() throws Exception
|
||||||
{
|
{
|
||||||
String shortName = GUID.generate();
|
String shortName = GUID.generate();
|
||||||
|
String secondShortName = GUID.generate();
|
||||||
createSite("myPreset", shortName, "myTitle", "myDescription", SiteVisibility.PUBLIC, 200);
|
createSite("myPreset", shortName, "myTitle", "myDescription", SiteVisibility.PUBLIC, 200);
|
||||||
|
createSite("myPreset", secondShortName, "myTitle", "myDescription", SiteVisibility.PUBLIC, 200);
|
||||||
|
|
||||||
String inviteComments = "Please sir, let me in";
|
String inviteComments = "Please sir, let me in";
|
||||||
String userName = USER_TWO;
|
String userName = USER_TWO;
|
||||||
@@ -805,10 +807,10 @@ public class SiteServiceTest extends AbstractSiteServiceTest
|
|||||||
String rejectURL = "page/reject-invite";
|
String rejectURL = "page/reject-invite";
|
||||||
|
|
||||||
//Create a new moderated invitation
|
//Create a new moderated invitation
|
||||||
String moderatedId = createModeratedInvitation(shortName, inviteComments, userName, roleName);
|
String moderatedId = createModeratedInvitation(secondShortName, inviteComments, userName, roleName);
|
||||||
|
|
||||||
// Get the moderated invitation
|
// Get the moderated invitation
|
||||||
sendRequest(new GetRequest(URL_SITES + "/" + shortName + "/invitations/" + moderatedId), 200);
|
sendRequest(new GetRequest(URL_SITES + "/" + secondShortName + "/invitations/" + moderatedId), 200);
|
||||||
|
|
||||||
// search for the moderated invitation
|
// search for the moderated invitation
|
||||||
sendRequest(new GetRequest(URL_SITES + "/" + shortName + "/invitations?inviteeUserName=" + userName), 200);
|
sendRequest(new GetRequest(URL_SITES + "/" + shortName + "/invitations?inviteeUserName=" + userName), 200);
|
||||||
@@ -820,7 +822,7 @@ public class SiteServiceTest extends AbstractSiteServiceTest
|
|||||||
sendRequest(new GetRequest(URL_SITES + "/" + shortName + "/invitations"), 200);
|
sendRequest(new GetRequest(URL_SITES + "/" + shortName + "/invitations"), 200);
|
||||||
|
|
||||||
// cancel the moderated invitation
|
// cancel the moderated invitation
|
||||||
sendRequest(new DeleteRequest(URL_SITES + "/" + shortName + "/invitations/" + moderatedId), 200);
|
sendRequest(new DeleteRequest(URL_SITES + "/" + secondShortName + "/invitations/" + moderatedId), 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1502,4 +1504,25 @@ public class SiteServiceTest extends AbstractSiteServiceTest
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testMultipleInviteRequests() throws Exception
|
||||||
|
{
|
||||||
|
String shortName = GUID.generate();
|
||||||
|
createSite("myPreset", shortName, "myTitle", "myDescription", SiteVisibility.MODERATED, 200);
|
||||||
|
String userName = USER_TWO;
|
||||||
|
String roleName = SiteModel.SITE_CONSUMER;
|
||||||
|
String inviteComments = "Request to join";
|
||||||
|
|
||||||
|
try {
|
||||||
|
//Create a new moderated invitation
|
||||||
|
String moderatedInvitationId = createModeratedInvitation(shortName, inviteComments, userName, roleName);
|
||||||
|
//Create another invitation
|
||||||
|
String newModeratedInvitationId = createModeratedInvitation(shortName, inviteComments, userName, roleName);
|
||||||
|
fail("A request to join this site is already in pending");
|
||||||
|
}
|
||||||
|
catch (AssertionFailedError e) {
|
||||||
|
// Ignore since we where expecting this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user