use of de.westnordost.osmapi.notes.Note in project StreetComplete by westnordost.
the class OsmNoteQuestDaoTest method testAddGetWithChanges.
public void testAddGetWithChanges() {
Note note = NoteDaoTest.createNote();
ArrayList<String> imagePaths = new ArrayList<>();
imagePaths.add("blubbi");
imagePaths.add("diblub");
OsmNoteQuest quest = new OsmNoteQuest(null, note, QuestStatus.ANSWERED, "hi da du", new Date(1234), questType, imagePaths);
noteDao.put(note);
dao.add(quest);
OsmNoteQuest dbQuest = dao.get(quest.getId());
checkEqual(quest, dbQuest);
}
use of de.westnordost.osmapi.notes.Note in project StreetComplete by westnordost.
the class OsmNoteQuestDaoTest method testAddReplace.
public void testAddReplace() {
Note note = NoteDaoTest.createNote();
noteDao.put(note);
OsmNoteQuest quest = new OsmNoteQuest(note, questType);
dao.add(quest);
OsmNoteQuest questForSameNote = new OsmNoteQuest(note, questType);
questForSameNote.setStatus(QuestStatus.HIDDEN);
boolean result = dao.replace(questForSameNote);
List<OsmNoteQuest> quests = dao.getAll(null, null);
assertEquals(1, quests.size());
assertEquals(QuestStatus.HIDDEN, quests.get(0).getStatus());
assertTrue(result);
}
Aggregations