Skip to content
Snippets Groups Projects
Commit 9ea7c309 authored by brinn's avatar brinn
Browse files

Add capability REGISTER_SPACE for registering a new space and make the user of...

Add capability REGISTER_SPACE for registering a new space and make the user of the session space admin of the new space except if he is already instance admin (fix unit test).

SVN: 28621
parent 6ea53905
No related branches found
No related tags found
No related merge requests found
...@@ -437,23 +437,27 @@ public final class CommonServerTest extends AbstractServerTestCase ...@@ -437,23 +437,27 @@ public final class CommonServerTest extends AbstractServerTestCase
} }
@Test @Test
public void testRegisterGroup() public void testRegisterSpace()
{ {
prepareGetSession(); prepareGetSession();
final String groupCode = "group"; final String spaceCode = "group";
final String description = "description"; final String description = "description";
final PersonPE person = createPersonWithRoleAssignmentsFromPrincipal(PRINCIPAL);
context.checking(new Expectations() context.checking(new Expectations()
{ {
{ {
one(commonBusinessObjectFactory).createSpaceBO(session); one(commonBusinessObjectFactory).createSpaceBO(session);
will(returnValue(groupBO)); will(returnValue(groupBO));
one(groupBO).define(groupCode, description); one(groupBO).define(spaceCode, description);
one(groupBO).save(); one(groupBO).save();
one(personDAO).tryFindPersonByUserId(CommonTestUtils.USER_ID);
will(returnValue(person));
} }
}); });
createServer().registerSpace(SESSION_TOKEN, groupCode, description); createServer().registerSpace(SESSION_TOKEN, spaceCode, description);
context.assertIsSatisfied(); context.assertIsSatisfied();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment