Search in sources :

Example 1 with QuestStatisticsDao

use of de.westnordost.streetcomplete.data.statistics.QuestStatisticsDao 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");
}
Also used : OsmQuestUnlocker(de.westnordost.streetcomplete.data.osm.OsmQuestUnlocker) Element(de.westnordost.osmapi.map.data.Element) OsmQuestDao(de.westnordost.streetcomplete.data.osm.persist.OsmQuestDao) MapDataDao(de.westnordost.osmapi.map.MapDataDao) OsmQuest(de.westnordost.streetcomplete.data.osm.OsmQuest) QuestStatisticsDao(de.westnordost.streetcomplete.data.statistics.QuestStatisticsDao) MergedElementDao(de.westnordost.streetcomplete.data.osm.persist.MergedElementDao)

Aggregations

MapDataDao (de.westnordost.osmapi.map.MapDataDao)1 Element (de.westnordost.osmapi.map.data.Element)1 OsmQuest (de.westnordost.streetcomplete.data.osm.OsmQuest)1 OsmQuestUnlocker (de.westnordost.streetcomplete.data.osm.OsmQuestUnlocker)1 MergedElementDao (de.westnordost.streetcomplete.data.osm.persist.MergedElementDao)1 OsmQuestDao (de.westnordost.streetcomplete.data.osm.persist.OsmQuestDao)1 QuestStatisticsDao (de.westnordost.streetcomplete.data.statistics.QuestStatisticsDao)1