@Test
public void testCreateSubcommunityAuth() throws Exception
{

    new NonStrictExpectations(authorizeService.getClass())
    {{
        // Allow current Community ADD perms
        authorizeService.authorizeAction((Context) any, (Community) any,
                Constants.ADD); result = null;
        // Allow *parent* Community ADD perms
        authorizeService.authorizeActionBoolean((Context) any, (Community) any,
                Constants.ADD); result = true;
    }};
    Community result = communityService.createSubcommunity(context, c);
    assertThat("testCreateSubcommunityAuth 0",c.getSubcommunities(), notNullValue());
    assertTrue("testCreateSubcommunityAuth 1", c.getSubcommunities().size() == 1);
    assertThat("testCreateSubcommunityAuth 2", c.getSubcommunities().get(0), equalTo(result));
}