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:
Matt Ward
2017-01-23 11:39:01 +00:00
parent 688a068f2a
commit 6a0be6cd7a
2 changed files with 37 additions and 9 deletions

View File

@@ -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);
}
}