mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.2.N (5.2.1) to HEAD (5.2)
131909 mward: REPO-892: allow creation of enabled/disabled users git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@132319 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -176,7 +176,45 @@ public class TestPeople extends EnterpriseTestApi
|
||||
assertEquals(true, p.isEnabled());
|
||||
assertEquals(true, p.isEmailNotificationsEnabled());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatePerson_canCreateDisabledPerson() throws PublicApiException
|
||||
{
|
||||
publicApiClient.setRequestContext(new RequestContext(account1.getId(), account1Admin, "admin"));
|
||||
|
||||
// Person disabled
|
||||
{
|
||||
PersonUpdate person = new PersonUpdate.Builder().
|
||||
id("myUserName04@"+account1.getId()).
|
||||
firstName("Firstname").
|
||||
email("myUserName04@"+account1.getId()).
|
||||
enabled(false).
|
||||
build();
|
||||
|
||||
Person p = people.create(person);
|
||||
assertEquals(false, p.isEnabled());
|
||||
// Check that a freshly retrieved person exhibits the same result
|
||||
p = people.getPerson(person.getUserName());
|
||||
assertEquals(false, p.isEnabled());
|
||||
}
|
||||
|
||||
// Person enabled
|
||||
{
|
||||
PersonUpdate person = new PersonUpdate.Builder().
|
||||
id("myUserName05@"+account1.getId()).
|
||||
firstName("Firstname").
|
||||
email("myUserName05@"+account1.getId()).
|
||||
enabled(true).
|
||||
build();
|
||||
|
||||
Person p = people.create(person);
|
||||
assertEquals(true, p.isEnabled());
|
||||
// Check that a freshly retrieved person exhibits the same result
|
||||
p = people.getPerson(person.getUserName());
|
||||
assertEquals(true, p.isEnabled());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatePerson_notAllFieldsRequired() throws Exception
|
||||
{
|
||||
@@ -211,7 +249,7 @@ public class TestPeople extends EnterpriseTestApi
|
||||
assertEquals(null, p.getMobile());
|
||||
assertEquals("1234 5678 9012", p.getTelephone());
|
||||
assertEquals(null, p.getUserStatus());
|
||||
assertEquals(true, p.isEnabled());
|
||||
assertEquals(false, p.isEnabled());
|
||||
assertEquals(false, p.isEmailNotificationsEnabled());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user