use of de.westnordost.streetcomplete.data.osm.persist.OsmQuestDao in project StreetComplete by westnordost.
the class OsmQuestChangesUploadTest method testDropChangeWhenUnresolvableElementChange.
public void testDropChangeWhenUnresolvableElementChange() {
OsmQuest quest = createAnsweredQuestWithNonAppliableChange();
Element element = createElement();
OsmQuestDao questDb = mock(OsmQuestDao.class);
MergedElementDao elementDao = mock(MergedElementDao.class);
DownloadedTilesDao downloadedTilesDao = mock(DownloadedTilesDao.class);
OsmQuestChangesUpload u = new OsmQuestChangesUpload(null, questDb, elementDao, null, null, null, null, downloadedTilesDao, null, null);
assertFalse(u.uploadQuestChange(123, quest, element, false, false));
verify(questDb).delete(quest.getId());
verify(downloadedTilesDao).remove(any(Point.class));
}
use of de.westnordost.streetcomplete.data.osm.persist.OsmQuestDao in project StreetComplete by westnordost.
the class OsmQuestChangesUploadTest method testUploadNormally.
public void testUploadNormally() {
OsmQuest quest = createAnsweredQuestWithAppliableChange();
Element element = createElement();
OsmQuestDao questDb = mock(OsmQuestDao.class);
MapDataDao mapDataDao = mock(MapDataDao.class);
QuestStatisticsDao statisticsDao = mock(QuestStatisticsDao.class);
MergedElementDao elementDb = mock(MergedElementDao.class);
OsmQuestUnlocker osmQuestUnlocker = mock(OsmQuestUnlocker.class);
OsmQuestChangesUpload u = new OsmQuestChangesUpload(mapDataDao, questDb, elementDb, null, statisticsDao, null, null, null, null, osmQuestUnlocker);
assertTrue(u.uploadQuestChange(1, quest, element, false, false));
assertEquals(QuestStatus.CLOSED, quest.getStatus());
verify(statisticsDao).addOne("TestQuestType");
}
Aggregations