GroupProviderServiceSQLImpl implements GroupProviderService { @Override public GroupProvider getGroupProviderByStringIdentifier(String identifier) { Object[] args = {identifier}; try { return this.jdbcTemplate.queryForObject( SELECT_GROUP_PROVIDER_BY_IDENTIFIER + '=' + '?', args, new RowMapper<GroupProvider>() { @Override public GroupProvider mapRow(ResultSet rs, int rowNum) throws SQLException { return mapRowToGroupProvider(rs); } }); } catch (EmptyResultDataAccessException e) { return null; } } 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 testGetGroupProviderByStringIdentifier() { GroupProvider groupProvider = groupProviderServiceSQL.getGroupProviderByStringIdentifier("grouper"); assertEquals("SURFteams grouper",groupProvider.getName()); }
@Test public void testGetBasicAuthProvider() throws Exception { GroupProvider groupProvider = groupProviderServiceSQL.getGroupProviderByStringIdentifier("mock"); assertEquals(GroupProviderType.BASIC_AUTHENTICATION, groupProvider.getGroupProviderType()); }