mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
59064: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 59042: Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1) 58919 : MNT-9205 : Search by IM property with spaces doesn't work - Using correct regexp to split search term. Added a test git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62089 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,6 +29,7 @@ import org.alfresco.service.cmr.security.MutableAuthenticationService;
|
||||
import org.alfresco.service.cmr.security.NoSuchPersonException;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.util.PropertyMap;
|
||||
import org.springframework.extensions.surf.util.URLEncoder;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
import org.springframework.extensions.webscripts.TestWebScriptServer.DeleteRequest;
|
||||
import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest;
|
||||
@@ -196,6 +197,28 @@ public class PersonServiceTest extends BaseWebScriptTest
|
||||
Response response = sendRequest(new GetRequest(URL_PEOPLE), 200);
|
||||
}
|
||||
|
||||
public void testJobWithSpace() throws Exception
|
||||
{
|
||||
String userName = RandomStringUtils.randomNumeric(6);
|
||||
String userJob = "myJob" + RandomStringUtils.randomNumeric(2) + " myJob" + RandomStringUtils.randomNumeric(3);
|
||||
|
||||
//we need to ecape a spaces for search
|
||||
String jobSearchString = userJob.replace(" ", "\\ ");
|
||||
|
||||
createPerson(userName, "myTitle", "myFirstName", "myLastName", "myOrganisation",
|
||||
userJob, "firstName.lastName@email.com", "myBio", "images/avatar.jpg",
|
||||
Status.STATUS_OK);
|
||||
|
||||
// Get a person
|
||||
Response response = sendRequest(new GetRequest(URL_PEOPLE + "?filter=" + URLEncoder.encode("jobtitle:" + jobSearchString)), 200);
|
||||
JSONObject res = new JSONObject(response.getContentAsString());
|
||||
assertEquals(1, res.getJSONArray("people").length());
|
||||
|
||||
response = sendRequest(new GetRequest(URL_PEOPLE + "?filter=" + URLEncoder.encode("jobtitle:" + userJob)), 200);
|
||||
res = new JSONObject(response.getContentAsString());
|
||||
assertEquals(0, res.getJSONArray("people").length());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void testGetPerson() throws Exception
|
||||
{
|
||||
|
Reference in New Issue
Block a user