Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jocmp committed Dec 26, 2024
1 parent 41e676e commit a190392
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ 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
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
Expand Down Expand Up @@ -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<FeedFinder>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit a190392

Please sign in to comment.