Example usage for com.liferay.portal.kernel.model UserGroup getGroupId

List of usage examples for com.liferay.portal.kernel.model UserGroup getGroupId

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model UserGroup getGroupId.

Prototype

public long getGroupId() throws com.liferay.portal.kernel.exception.PortalException;

Source Link

Usage

From source file:com.liferay.user.groups.admin.web.internal.search.test.UserGroupIndexerTest.java

License:Open Source License

@Test
public void testSearchUserGroups() throws Exception {
    _role = RoleTestUtil.addRole(RoleConstants.TYPE_REGULAR);

    long companyId = _role.getCompanyId();

    int count = _userGroupLocalService.searchCount(companyId, null, new LinkedHashMap<String, Object>());

    UserGroup userGroup = addUserGroup();

    addUserGroup();//w  ww. j  a va  2 s .  c o m

    GroupLocalServiceUtil.addRoleGroup(_role.getRoleId(), userGroup.getGroupId());

    Hits hits = search(companyId);

    Assert.assertEquals(hits.toString(), count + 2, hits.getLength());
}