GroupProviderServiceSQLImpl implements GroupProviderService { @Override public List<GroupProvider> getOAuthGroupProviders(String userId) { List<GroupProvider> groupProviders; Object[] args = {userId}; try { groupProviders = this.jdbcTemplate.query( SELECT_GROUP_PROVIDER_BY_IDENTIFIER + " IN (SELECT gp_user_oauth.provider_id " + " FROM group_provider_user_oauth as gp_user_oauth " + " WHERE gp_user_oauth.user_id = ?);", args, new RowMapper<GroupProvider>() { @Override public GroupProvider mapRow(ResultSet rs, int rowNum) throws SQLException { return mapRowToGroupProvider(rs); } }); } catch (EmptyResultDataAccessException e) { groupProviders = new ArrayList<GroupProvider>(); } return groupProviders; } 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 testGetOAuthGroupProviders() { List<GroupProvider> providers = groupProviderServiceSQL.getOAuthGroupProviders("urn:collab:person:test.surfguest.nl:tester"); assertEquals(1,providers.size()); GroupProvider groupProvider = providers.get(0); List<ServiceProviderGroupAcl> acls = groupProvider.getServiceProviderGroupAcls(); assertEquals(2, acls.size()); }