GroupProviderServiceSQLImpl implements GroupProviderService { @Override public List<GroupProvider> getAllGroupProviders() { try { return this.jdbcTemplate.query( SELECT_ALL_GROUP_PROVIDER, new RowMapper<GroupProvider>() { @Override public GroupProvider mapRow(ResultSet rs, int rowNum) throws SQLException { return mapRowToGroupProvider(rs); } }); } catch (EmptyResultDataAccessException e) { return new ArrayList<GroupProvider>(); } } GroupProviderServiceSQLImpl(JdbcTemplate jdbcTemplate); @Override List<GroupProviderUserOauth> getGroupProviderUserOauths(String userId); @Override GroupProviderUserOauth getGroupProviderUserOauth(String userId, String groupProviderIdentifier); @Override GroupProvider getGroupProviderByStringIdentifier(String identifier); @Override List<GroupProvider> getOAuthGroupProviders(String userId); @Override List<GroupProvider> getAllGroupProviders();  }
@Test public void testGetAllGroupProviders() throws Exception { List<GroupProvider> all = groupProviderServiceSQL.getAllGroupProviders(); assertEquals(4,all.size()); boolean grouperPresent = false; for (GroupProvider groupProvider : all) { if (groupProvider.getGroupProviderType().equals(GroupProviderType.GROUPER)) { grouperPresent = true; break; } } assertTrue(grouperPresent); }
@Test public void serializeGroupProvider() { List<GroupProvider> all = groupProviderServiceSQL.getAllGroupProviders(); byte[] serialize = SerializationUtils.serialize((Serializable)all); }