@Test
public void allGroupsOfAnUserTest(){

    int grpTestUserNum = 5, grpUUserNum = 3;
    String usrTestName = "test";
    String usrTestPasswd = "test";
    User testUser = new User();
    testUser.setName(usrTestName);
    testUser.setRole(Role.USER);
    testUser.setNewPassword(usrTestPasswd);
    Set<UserGroup> testUserGroups = createSomeGroups(grpTestUserNum, usrTestName);
    addSomeUserGroups(testUserGroups);
    testUser.setGroups(testUserGroups);
    geoStoreClient.insert(testUser);
    User u = new User();
    u.setName("u");
    u.setRole(Role.USER);
    Set<UserGroup> uGroups = createSomeGroups(grpUUserNum, "u");
    addSomeUserGroups(uGroups);
    u.setGroups(uGroups);
    geoStoreClient.insert(u);
    GeoStoreClient userClient = createUserClient(usrTestName, usrTestPasswd);
    ExtGroupList result = userClient.searchUserGroup(0, 10, "*");
    assertEquals(result.getCount(), grpTestUserNum);
}