From a1903924ba278c3d2801d1f4e2f526a17132c837 Mon Sep 17 00:00:00 2001 From: Josiah Campbell <9521010+jocmp@users.noreply.github.com> Date: Wed, 25 Dec 2024 20:50:15 -0500 Subject: [PATCH] Fix tests --- .../com/jocmp/capy/accounts/LocalAccountDelegateTest.kt | 6 ++++++ .../jocmp/capy/accounts/reader/ReaderAccountDelegateTest.kt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/capy/src/test/java/com/jocmp/capy/accounts/LocalAccountDelegateTest.kt b/capy/src/test/java/com/jocmp/capy/accounts/LocalAccountDelegateTest.kt index 62b6a573..213171ea 100644 --- a/capy/src/test/java/com/jocmp/capy/accounts/LocalAccountDelegateTest.kt +++ b/capy/src/test/java/com/jocmp/capy/accounts/LocalAccountDelegateTest.kt @@ -4,6 +4,7 @@ import com.jocmp.capy.AccountDelegate import com.jocmp.capy.InMemoryDatabaseProvider import com.jocmp.capy.db.Database import com.jocmp.capy.fixtures.FeedFixture +import com.jocmp.capy.logging.CapyLog import com.jocmp.capy.persistence.ArticleRecords import com.jocmp.capy.rssItemFixture import com.jocmp.feedfinder.FeedFinder @@ -11,7 +12,9 @@ import com.jocmp.feedfinder.parser.Feed import com.jocmp.rssparser.model.RssChannel import com.jocmp.rssparser.model.RssItem import io.mockk.coEvery +import io.mockk.every import io.mockk.mockk +import io.mockk.mockkObject import kotlinx.coroutines.test.runTest import okhttp3.OkHttpClient import org.junit.Before @@ -70,6 +73,9 @@ class LocalAccountDelegateTest { @Before fun setup() { + mockkObject(CapyLog) + every { CapyLog.warn(any(), any()) }.returns(Unit) + database = InMemoryDatabaseProvider.build(accountID) feedFixture = FeedFixture(database) feedFinder = mockk() diff --git a/capy/src/test/java/com/jocmp/capy/accounts/reader/ReaderAccountDelegateTest.kt b/capy/src/test/java/com/jocmp/capy/accounts/reader/ReaderAccountDelegateTest.kt index 797e7c1e..d2ffad86 100644 --- a/capy/src/test/java/com/jocmp/capy/accounts/reader/ReaderAccountDelegateTest.kt +++ b/capy/src/test/java/com/jocmp/capy/accounts/reader/ReaderAccountDelegateTest.kt @@ -7,6 +7,7 @@ import com.jocmp.capy.accounts.AddFeedResult import com.jocmp.capy.articles.UnreadSortOrder import com.jocmp.capy.db.Database import com.jocmp.capy.fixtures.FeedFixture +import com.jocmp.capy.logging.CapyLog import com.jocmp.capy.persistence.ArticleRecords import com.jocmp.readerclient.Category import com.jocmp.readerclient.GoogleReader @@ -23,7 +24,9 @@ import com.jocmp.readerclient.SubscriptionListResult import com.jocmp.readerclient.SubscriptionQuickAddResult import io.mockk.coEvery import io.mockk.coVerify +import io.mockk.every import io.mockk.mockk +import io.mockk.mockkObject import kotlinx.coroutines.test.runTest import okhttp3.Headers import okhttp3.MediaType.Companion.toMediaType @@ -95,6 +98,9 @@ class ReaderAccountDelegateTest { @BeforeTest fun setup() { + mockkObject(CapyLog) + every { CapyLog.warn(any(), any()) }.returns(Unit) + database = InMemoryDatabaseProvider.build(accountID) feedFixture = FeedFixture(database) googleReader = mockk()