mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
REPO-1813: 500 Response Code when creating a person without id
Now returns 400. Also fixed to return 400 when user id starts with GROUP_ or ROLE_ git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@134714 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -300,6 +300,19 @@ public class TestPeople extends EnterpriseTestApi
|
||||
person.setUserName("myUser/Name@" + account1.getId());
|
||||
people.create(person, 400);
|
||||
|
||||
// check for reserved authority prefixes
|
||||
person.setUserName("GROUP_EVERYONE");
|
||||
people.create(person, 400);
|
||||
|
||||
person.setUserName("GROUP_mygroup");
|
||||
people.create(person, 400);
|
||||
|
||||
person.setUserName("ROLE_ANYTHING");
|
||||
people.create(person, 400);
|
||||
|
||||
// lower case
|
||||
person.setUserName("role_whatever");
|
||||
people.create(person, 400);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -456,10 +469,14 @@ public class TestPeople extends EnterpriseTestApi
|
||||
|
||||
// -ve: not enough fields!
|
||||
{
|
||||
// Create a person with no fields set.
|
||||
// Create a person with no fields other than user ID set.
|
||||
Person person = new Person();
|
||||
person.setUserName("joe.bloggs.2@"+account1.getId());
|
||||
people.create(person, 400);
|
||||
|
||||
// Missing ID
|
||||
person.setUserName(null);
|
||||
people.create(person, 400);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user