CompositeUserRoleListService implements IUserRoleListService { @Override public List<String> getSystemRoles() { return collectResultsForOperation( new CompositeOperation() { @Override public List<String> perform( IUserRoleListService service ) { return service.getSystemRoles(); } } ); } CompositeUserRoleListService( List<IUserRoleListService> delegates ); void setStrategy( STRATEGY strategy ); void setStrategy( String strategy ); STRATEGY getActiveStrategy(); @Override List<String> getAllRoles(); @Override List<String> getSystemRoles(); @Override List<String> getAllRoles( final ITenant tenant ); @Override List<String> getAllUsers(); @Override List<String> getAllUsers( final ITenant tenant ); @Override List<String> getUsersInRole( final ITenant tenant, final String role ); @Override List<String> getRolesForUser( final ITenant tenant, final String username );  }
@Test public void testGetSystemRoles() throws Exception { List<String> allRoles = compositeService.getSystemRoles(); assertEquals( 2, allRoles.size() ); compositeService.setStrategy( CompositeUserRoleListService.STRATEGY.ADDITIVE ); allRoles = compositeService.getSystemRoles(); assertEquals( 3, allRoles.size() ); assertTrue( unsortedEqualArrays( allRoles.toArray( new String[allRoles.size()] ), new String[]{"authenticated", "anonymous", "serveradmin"} ) ); }