JDBCProjectQueries implements ProjectQueries { @Override public String idFromNameQuery(String name) { return "SELECT id FROM project WHERE name = '" + name + "'"; }  @Override String projectInsertStatement(String projectName, String url); @Override String idFromNameQuery(String name);  }
@Test public void testIdFromNameQuery() { List<Map<String, Object>> result; String name = "projectName"; String anotherProject = "anotherProject"; String url = "my/url"; result = persistence.query(queries.idFromNameQuery(name)); assertTrue(result.isEmpty()); executeSuccess(queries.projectInsertStatement(name, url)); result = persistence.query(queries.idFromNameQuery(anotherProject)); assertTrue(result.isEmpty()); result = persistence.query(queries.idFromNameQuery(name)); assertFalse(result.isEmpty()); assertEquals(1, result.get(0).get("id")); executeSuccess(queries.projectInsertStatement(anotherProject, null)); result = persistence.query(queries.idFromNameQuery(anotherProject)); assertFalse(result.isEmpty()); assertEquals(2, result.get(0).get("id")); }