EngineBlockImpl implements EngineBlock { @Override public String getUserUUID(String identifier) { Assert.hasText(identifier, "Not allowed to provide a null or empty identifier"); String sql = "SELECT user_uuid FROM saml_persistent_id WHERE persistent_id = ?"; LOG.debug("Executing query with identifier {}: {}", identifier, sql); List<String> results = ebJdbcTemplate.query(sql, new String[] { identifier }, new RowMapper<String>() { @Override public String mapRow(ResultSet rs, int rowNum) throws SQLException { return rs.getString(1); } }); if (CollectionUtils.isEmpty(results)) { throw new RuntimeException("No persistent_id found for user_uuid("+identifier+")"); } LOG.debug("Numer of results from query: {}", results.size()); return results.get(0); }  @Override String getUserUUID(String identifier); void setEbJdbcTemplate(JdbcTemplate ebJdbcTemplate);  }
@Test public void testGetPersistentNameIdentifier() { initEngineBlock(); String persistentNameIdentifier = engineBlock.getUserUUID("persistent"); assertEquals("user_uuid", persistentNameIdentifier); }