@Test
public void testSmellIdQuery() {

    List<Map<String, Object>> result;
    // No smell means no result
    result = persistence.query(queries.smellIdQuery(projectId, smell));
    assertTrue(result.isEmpty());
    Smell anotherSmellType = new Smell("MIM", smell.instance, smell.file);
    executeSuccess(queries.smellInsertionStatement(projectId, smell));
    // Another smell means no result
    result = persistence.query(queries.smellIdQuery(projectId, anotherSmellType));
    assertTrue(result.isEmpty());
    // We can query our smell
    result = persistence.query(queries.smellIdQuery(projectId, smell));
    assertFalse(result.isEmpty());
    assertEquals(1, result.get(0).get("id"));
    // The same smell with parent is not returned
    smell.parent = anotherSmellType;
    result = persistence.query(queries.smellIdQuery(projectId, smell));
    assertTrue(result.isEmpty());
    anotherSmellType.id = createSmell(projectId, anotherSmellType, queries);
    executeSuccess(queries.smellInsertionStatement(projectId, smell));
    // Our parent smell is now inserted
    result = persistence.query(queries.smellIdQuery(projectId, anotherSmellType));
    assertFalse(result.isEmpty());
    assertEquals(2, result.get(0).get("id"));
    // The smell with parent is now inserted
    result = persistence.query(queries.smellIdQuery(projectId, smell));
    assertFalse(result.isEmpty());
    assertEquals(3, result.get(0).get("id"));
    // We can't insert two times the same smell
    executeNothinhDone(queries.smellInsertionStatement(projectId, smell));
}