#1449 fix test and mark deprecated

This commit is contained in:
Sean Mac Gillicuddy 2019-09-10 15:34:49 +01:00
parent 941f02eefd
commit aa61a937bf
2 changed files with 2 additions and 7 deletions

View File

@ -23,9 +23,7 @@ import com.yahoo.squidb.sql.Query;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.kiwix.kiwixmobile.data.ZimContentProvider;
import org.kiwix.kiwixmobile.data.local.KiwixDatabase;
import org.kiwix.kiwixmobile.data.local.entity.RecentSearch;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@ -58,10 +56,6 @@ public class RecentSearchDaoTest {
recentSearchDao.getRecentSearches();
// verify ordering is in descending order of search ID and the results are limited to 5 only
verify(kiwixDatabase).query(any(),
eq(Query.selectDistinct(RecentSearch.SEARCH_STRING).where(RecentSearch.ZIM_I_D.eq(
ZimContentProvider.getId()))
.orderBy(RecentSearch.ID.desc())
.limit(5)));
verify(kiwixDatabase).query(any(), eq(Query.select()));
}
}

View File

@ -50,6 +50,7 @@ import org.kiwix.kiwixmobile.utils.UpdateUtils;
import static org.kiwix.kiwixmobile.utils.Constants.TAG_KIWIX;
@Singleton
@Deprecated //delete once migrations are no longer needed
public class KiwixDatabase extends SquidDatabase {
private static final int TWO_POINT_FIVE_POINT_THREE = 16;