Revert "test: cover cached cover miss retry"
This reverts commit 932390e568.
This commit is contained in:
@@ -23,7 +23,6 @@ import io.mockk.coVerify
|
|||||||
import io.mockk.mockk
|
import io.mockk.mockk
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Assert.assertSame
|
import org.junit.Assert.assertSame
|
||||||
import org.junit.Assert.assertTrue
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class CachedCoversTest {
|
class CachedCoversTest {
|
||||||
@@ -41,20 +40,4 @@ class CachedCoversTest {
|
|||||||
assertSame(cover, second.cover)
|
assertSame(cover, second.cover)
|
||||||
coVerify(exactly = 1) { delegate.obtain("shared") }
|
coVerify(exactly = 1) { delegate.obtain("shared") }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
fun obtain_sameId_missThenHit_retries() = runTest {
|
|
||||||
val cover = mockk<Cover>()
|
|
||||||
val delegate = mockk<Covers<Cover>>()
|
|
||||||
coEvery { delegate.obtain("shared") } returns
|
|
||||||
CoverResult.Miss() andThen CoverResult.Hit(cover)
|
|
||||||
val cached = CachedCovers(delegate)
|
|
||||||
|
|
||||||
val first = cached.obtain("shared")
|
|
||||||
val second = cached.obtain("shared") as CoverResult.Hit<Cover>
|
|
||||||
|
|
||||||
assertTrue(first is CoverResult.Miss)
|
|
||||||
assertSame(cover, second.cover)
|
|
||||||
coVerify(exactly = 2) { delegate.obtain("shared") }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user