@Test public void testGetExternalGroupByIdentifier_DoesNotExist() throws Exception { String identifier = NON_EXISTING_EXTERNAL_GROUP_IDENT; final ExternalGroup group = teamExternalGroupDao.getExternalGroupByIdentifier(identifier); assertNull(group); }
@Override public ExternalGroup getExternalGroupByIdentifier(String identifier) { Object[] args = {identifier}; try { return this.jdbcTemplate.queryForObject("SELECT * FROM external_groups AS eg WHERE eg.identifier = ?", args, new RowMapper<ExternalGroup>() { @Override public ExternalGroup mapRow(ResultSet rs, int rowNum) throws SQLException { final ExternalGroup e = new ExternalGroup(); e.setId(rs.getLong("id")); e.setIdentifier(rs.getString(IDENTIFIER)); e.setDescription(rs.getString(DESCRIPTION)); e.setName(rs.getString(NAME)); e.setGroupProviderIdentifier(rs.getString(GROUP_PROVIDER)); return e; } }); } catch (EmptyResultDataAccessException er) { return null; } }
TeamExternalGroupDaoImpl implements TeamExternalGroupDao { @Override public ExternalGroup getExternalGroupByIdentifier(String identifier) { Object[] args = {identifier}; try { return this.jdbcTemplate.queryForObject("SELECT * FROM external_groups AS eg WHERE eg.identifier = ?", args, new RowMapper<ExternalGroup>() { @Override public ExternalGroup mapRow(ResultSet rs, int rowNum) throws SQLException { final ExternalGroup e = new ExternalGroup(); e.setId(rs.getLong("id")); e.setIdentifier(rs.getString(IDENTIFIER)); e.setDescription(rs.getString(DESCRIPTION)); e.setName(rs.getString(NAME)); e.setGroupProviderIdentifier(rs.getString(GROUP_PROVIDER)); return e; } }); } catch (EmptyResultDataAccessException er) { return null; } } }
TeamExternalGroupDaoImpl implements TeamExternalGroupDao { @Override public ExternalGroup getExternalGroupByIdentifier(String identifier) { Object[] args = {identifier}; try { return this.jdbcTemplate.queryForObject("SELECT * FROM external_groups AS eg WHERE eg.identifier = ?", args, new RowMapper<ExternalGroup>() { @Override public ExternalGroup mapRow(ResultSet rs, int rowNum) throws SQLException { final ExternalGroup e = new ExternalGroup(); e.setId(rs.getLong("id")); e.setIdentifier(rs.getString(IDENTIFIER)); e.setDescription(rs.getString(DESCRIPTION)); e.setName(rs.getString(NAME)); e.setGroupProviderIdentifier(rs.getString(GROUP_PROVIDER)); return e; } }); } catch (EmptyResultDataAccessException er) { return null; } }  }
TeamExternalGroupDaoImpl implements TeamExternalGroupDao { @Override public ExternalGroup getExternalGroupByIdentifier(String identifier) { Object[] args = {identifier}; try { return this.jdbcTemplate.queryForObject("SELECT * FROM external_groups AS eg WHERE eg.identifier = ?", args, new RowMapper<ExternalGroup>() { @Override public ExternalGroup mapRow(ResultSet rs, int rowNum) throws SQLException { final ExternalGroup e = new ExternalGroup(); e.setId(rs.getLong("id")); e.setIdentifier(rs.getString(IDENTIFIER)); e.setDescription(rs.getString(DESCRIPTION)); e.setName(rs.getString(NAME)); e.setGroupProviderIdentifier(rs.getString(GROUP_PROVIDER)); return e; } }); } catch (EmptyResultDataAccessException er) { return null; } }  void setJdbcTemplate(JdbcTemplate tpl); @Override ExternalGroup getExternalGroupByIdentifier(String identifier); @Override List<TeamExternalGroup> getByTeamIdentifier(String identifier); @Override List<TeamExternalGroup> getByExternalGroupIdentifier(String identifier); @Override TeamExternalGroup getByTeamIdentifierAndExternalGroupIdentifier(String teamId, String externalGroupIdentifier); @Override void saveOrUpdate(TeamExternalGroup teamExternalGroup); @Override void delete(TeamExternalGroup teamExternalGroup); @Override List<TeamExternalGroup> getByExternalGroupIdentifiers(Collection<String> identifiers); }
TeamExternalGroupDaoImpl implements TeamExternalGroupDao { @Override public ExternalGroup getExternalGroupByIdentifier(String identifier) { Object[] args = {identifier}; try { return this.jdbcTemplate.queryForObject("SELECT * FROM external_groups AS eg WHERE eg.identifier = ?", args, new RowMapper<ExternalGroup>() { @Override public ExternalGroup mapRow(ResultSet rs, int rowNum) throws SQLException { final ExternalGroup e = new ExternalGroup(); e.setId(rs.getLong("id")); e.setIdentifier(rs.getString(IDENTIFIER)); e.setDescription(rs.getString(DESCRIPTION)); e.setName(rs.getString(NAME)); e.setGroupProviderIdentifier(rs.getString(GROUP_PROVIDER)); return e; } }); } catch (EmptyResultDataAccessException er) { return null; } }  void setJdbcTemplate(JdbcTemplate tpl); @Override ExternalGroup getExternalGroupByIdentifier(String identifier); @Override List<TeamExternalGroup> getByTeamIdentifier(String identifier); @Override List<TeamExternalGroup> getByExternalGroupIdentifier(String identifier); @Override TeamExternalGroup getByTeamIdentifierAndExternalGroupIdentifier(String teamId, String externalGroupIdentifier); @Override void saveOrUpdate(TeamExternalGroup teamExternalGroup); @Override void delete(TeamExternalGroup teamExternalGroup); @Override List<TeamExternalGroup> getByExternalGroupIdentifiers(Collection<String> identifiers);  }