@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));
    // Another project name means no result
    result = persistence.query(queries.idFromNameQuery(anotherProject));
    assertTrue(result.isEmpty());
    // We can query our project
    result = persistence.query(queries.idFromNameQuery(name));
    assertFalse(result.isEmpty());
    assertEquals(1, result.get(0).get("id"));
    // We can insert any other project.
    executeSuccess(queries.projectInsertStatement(anotherProject, null));
    result = persistence.query(queries.idFromNameQuery(anotherProject));
    assertFalse(result.isEmpty());
    assertEquals(2, result.get(0).get("id"));
}