@Test public void getGroups() { final ArrayList<Group20> group20s = new ArrayList<Group20>(); group20s.add(new Group20("foo", "bar", "baz")); when( jdbcTemplate.query(anyString(), (Object[]) anyVararg(), (ApiGrouperDaoImpl.OpenSocial20GroupRowMapper) anyObject())).thenReturn(group20s); assertEquals(1, dao.findAllGroup20sByMember("personid", 1, 1, "id").getEntry().size()); }
public Group20Entry findAllGroup20sByMember(String personId, Integer offset, Integer pageSize, String sortBy) { int rowCount = this.jdbcTemplate.queryForInt(SQL_FIND_ALL_TEAMS_BY_MEMBER_ROWCOUNT, personId); List<Group20> groups = new ArrayList<Group20>(); pageSize = correctPageSize(pageSize); offset = correctOffset(offset); try { String sql = formatAllTeamsSQLWithSortByOption(sortBy); groups = jdbcTemplate.query(sql, new Object[] { personId, pageSize, offset }, new OpenSocial20GroupRowMapper()); addRolesToGroups(personId, groups); } catch (EmptyResultDataAccessException e) { } return new Group20Entry(groups, pageSize, offset, sortBy, rowCount); }
ApiGrouperDaoImpl extends AbstractGrouperDaoImpl implements ApiGrouperDao { public Group20Entry findAllGroup20sByMember(String personId, Integer offset, Integer pageSize, String sortBy) { int rowCount = this.jdbcTemplate.queryForInt(SQL_FIND_ALL_TEAMS_BY_MEMBER_ROWCOUNT, personId); List<Group20> groups = new ArrayList<Group20>(); pageSize = correctPageSize(pageSize); offset = correctOffset(offset); try { String sql = formatAllTeamsSQLWithSortByOption(sortBy); groups = jdbcTemplate.query(sql, new Object[] { personId, pageSize, offset }, new OpenSocial20GroupRowMapper()); addRolesToGroups(personId, groups); } catch (EmptyResultDataAccessException e) { } return new Group20Entry(groups, pageSize, offset, sortBy, rowCount); } }
ApiGrouperDaoImpl extends AbstractGrouperDaoImpl implements ApiGrouperDao { public Group20Entry findAllGroup20sByMember(String personId, Integer offset, Integer pageSize, String sortBy) { int rowCount = this.jdbcTemplate.queryForInt(SQL_FIND_ALL_TEAMS_BY_MEMBER_ROWCOUNT, personId); List<Group20> groups = new ArrayList<Group20>(); pageSize = correctPageSize(pageSize); offset = correctOffset(offset); try { String sql = formatAllTeamsSQLWithSortByOption(sortBy); groups = jdbcTemplate.query(sql, new Object[] { personId, pageSize, offset }, new OpenSocial20GroupRowMapper()); addRolesToGroups(personId, groups); } catch (EmptyResultDataAccessException e) { } return new Group20Entry(groups, pageSize, offset, sortBy, rowCount); }  }
ApiGrouperDaoImpl extends AbstractGrouperDaoImpl implements ApiGrouperDao { public Group20Entry findAllGroup20sByMember(String personId, Integer offset, Integer pageSize, String sortBy) { int rowCount = this.jdbcTemplate.queryForInt(SQL_FIND_ALL_TEAMS_BY_MEMBER_ROWCOUNT, personId); List<Group20> groups = new ArrayList<Group20>(); pageSize = correctPageSize(pageSize); offset = correctOffset(offset); try { String sql = formatAllTeamsSQLWithSortByOption(sortBy); groups = jdbcTemplate.query(sql, new Object[] { personId, pageSize, offset }, new OpenSocial20GroupRowMapper()); addRolesToGroups(personId, groups); } catch (EmptyResultDataAccessException e) { } return new Group20Entry(groups, pageSize, offset, sortBy, rowCount); }  Group20Entry findGroup20(String personId, String groupName); Group20Entry findAllGroup20sByMember(String personId, Integer offset, Integer pageSize, String sortBy); void setJdbcTemplate(JdbcTemplate jdbcTemplate); @Override GroupMembersEntry findAllMembers(String groupId, Integer offset, Integer pageSize); @Override Group20Entry findGroups20ByIds(String personId, String[] groupIds, Integer pageSize, Integer offset); void setNamedParameterJdbcTemplate(NamedParameterJdbcTemplate namedParameterJdbcTemplate); }
ApiGrouperDaoImpl extends AbstractGrouperDaoImpl implements ApiGrouperDao { public Group20Entry findAllGroup20sByMember(String personId, Integer offset, Integer pageSize, String sortBy) { int rowCount = this.jdbcTemplate.queryForInt(SQL_FIND_ALL_TEAMS_BY_MEMBER_ROWCOUNT, personId); List<Group20> groups = new ArrayList<Group20>(); pageSize = correctPageSize(pageSize); offset = correctOffset(offset); try { String sql = formatAllTeamsSQLWithSortByOption(sortBy); groups = jdbcTemplate.query(sql, new Object[] { personId, pageSize, offset }, new OpenSocial20GroupRowMapper()); addRolesToGroups(personId, groups); } catch (EmptyResultDataAccessException e) { } return new Group20Entry(groups, pageSize, offset, sortBy, rowCount); }  Group20Entry findGroup20(String personId, String groupName); Group20Entry findAllGroup20sByMember(String personId, Integer offset, Integer pageSize, String sortBy); void setJdbcTemplate(JdbcTemplate jdbcTemplate); @Override GroupMembersEntry findAllMembers(String groupId, Integer offset, Integer pageSize); @Override Group20Entry findGroups20ByIds(String personId, String[] groupIds, Integer pageSize, Integer offset); void setNamedParameterJdbcTemplate(NamedParameterJdbcTemplate namedParameterJdbcTemplate);  }