Issue#11 Add annotation @OptIn(ExperimentalCoroutinesApi::class) where its needed
This commit is contained in:
parent
a71fa67de2
commit
e9a22dd60a
14 changed files with 27 additions and 1 deletions
|
|
@ -29,7 +29,7 @@ class ShadowSnackbar {
|
|||
@Implementation
|
||||
@JvmStatic
|
||||
fun make(view: View, text: CharSequence, duration: Int): Snackbar? {
|
||||
var snackbar: Snackbar? = null
|
||||
val snackbar: Snackbar?
|
||||
try {
|
||||
val constructor = Snackbar::class.java.getDeclaredConstructor(
|
||||
Context::class.java,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.fnives.test.showcase.ui.auth
|
||||
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import org.fnives.test.showcase.core.login.LoginUseCase
|
||||
import org.fnives.test.showcase.testutils.InstantExecutorExtension
|
||||
import org.fnives.test.showcase.testutils.TestMainDispatcher
|
||||
|
|
@ -12,6 +13,7 @@ import org.mockito.kotlin.mock
|
|||
|
||||
@Disabled("CodeKata")
|
||||
@ExtendWith(InstantExecutorExtension::class, TestMainDispatcher::class)
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class CodeKataAuthViewModel {
|
||||
|
||||
private lateinit var sut: AuthViewModel
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.fnives.test.showcase.core.content
|
||||
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.fnives.test.showcase.core.storage.content.FavouriteContentLocalStorage
|
||||
|
|
@ -17,6 +18,7 @@ import org.mockito.kotlin.verifyZeroInteractions
|
|||
import org.mockito.kotlin.whenever
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
internal class AddContentToFavouriteUseCaseTest {
|
||||
|
||||
private lateinit var sut: AddContentToFavouriteUseCase
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.fnives.test.showcase.core.content
|
||||
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.Disabled
|
||||
|
|
@ -7,6 +8,7 @@ import org.junit.jupiter.api.DisplayName
|
|||
import org.junit.jupiter.api.Test
|
||||
|
||||
@Disabled("CodeKata")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class CodeKataContentRepositoryTest {
|
||||
|
||||
@BeforeEach
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.fnives.test.showcase.core.content
|
||||
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.flow.take
|
||||
import kotlinx.coroutines.flow.toList
|
||||
|
|
@ -28,6 +29,7 @@ import org.mockito.kotlin.verifyNoMoreInteractions
|
|||
import org.mockito.kotlin.whenever
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
internal class ContentRepositoryTest {
|
||||
|
||||
private lateinit var sut: ContentRepository
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.fnives.test.showcase.core.content
|
||||
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.jupiter.api.Assertions.assertThrows
|
||||
|
|
@ -15,6 +16,7 @@ import org.mockito.kotlin.verifyZeroInteractions
|
|||
import org.mockito.kotlin.whenever
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
internal class FetchContentUseCaseTest {
|
||||
|
||||
private lateinit var sut: FetchContentUseCase
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.fnives.test.showcase.core.content
|
||||
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.take
|
||||
|
|
@ -21,6 +22,7 @@ import org.mockito.kotlin.mock
|
|||
import org.mockito.kotlin.whenever
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
internal class GetAllContentUseCaseTest {
|
||||
|
||||
private lateinit var sut: GetAllContentUseCase
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.fnives.test.showcase.core.content
|
||||
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.fnives.test.showcase.core.storage.content.FavouriteContentLocalStorage
|
||||
|
|
@ -17,6 +18,7 @@ import org.mockito.kotlin.verifyZeroInteractions
|
|||
import org.mockito.kotlin.whenever
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
internal class RemoveContentFromFavouritesUseCaseTest {
|
||||
|
||||
private lateinit var sut: RemoveContentFromFavouritesUseCase
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.fnives.test.showcase.core.content
|
|||
|
||||
import app.cash.turbine.test
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.flow.take
|
||||
import kotlinx.coroutines.flow.toList
|
||||
import kotlinx.coroutines.test.UnconfinedTestDispatcher
|
||||
|
|
@ -26,6 +27,7 @@ import org.mockito.kotlin.verify
|
|||
import org.mockito.kotlin.verifyNoMoreInteractions
|
||||
import org.mockito.kotlin.whenever
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class TurbineContentRepositoryTest {
|
||||
|
||||
private lateinit var sut: ContentRepository
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.fnives.test.showcase.core.content
|
||||
|
||||
import app.cash.turbine.test
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.fnives.test.showcase.core.storage.content.FavouriteContentLocalStorage
|
||||
|
|
@ -17,6 +18,7 @@ import org.mockito.kotlin.doReturn
|
|||
import org.mockito.kotlin.mock
|
||||
import org.mockito.kotlin.whenever
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class TurbineGetAllContentUseCaseTest {
|
||||
|
||||
private lateinit var sut: GetAllContentUseCase
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.fnives.test.showcase.core.login
|
||||
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.fnives.test.showcase.core.shared.UnexpectedException
|
||||
import org.fnives.test.showcase.core.storage.UserDataLocalStorage
|
||||
|
|
@ -23,6 +24,7 @@ import org.mockito.kotlin.verifyZeroInteractions
|
|||
import org.mockito.kotlin.whenever
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
internal class LoginUseCaseTest {
|
||||
|
||||
private lateinit var sut: LoginUseCase
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.fnives.test.showcase.core.login.hilt
|
||||
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.fnives.test.showcase.core.content.ContentRepository
|
||||
import org.fnives.test.showcase.core.login.LogoutUseCase
|
||||
|
|
@ -16,6 +17,7 @@ import org.mockito.kotlin.verifyZeroInteractions
|
|||
import javax.inject.Inject
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
internal class LogoutUseCaseTest {
|
||||
|
||||
@Inject
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.fnives.test.showcase.core.login.koin
|
||||
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.fnives.test.showcase.core.content.ContentRepository
|
||||
import org.fnives.test.showcase.core.di.koin.createCoreModule
|
||||
|
|
@ -21,6 +22,7 @@ import org.mockito.kotlin.verifyNoMoreInteractions
|
|||
import org.mockito.kotlin.verifyZeroInteractions
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
internal class LogoutUseCaseTest : KoinTest {
|
||||
|
||||
private lateinit var sut: LogoutUseCase
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.fnives.test.showcase.core.shared
|
||||
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.fnives.test.showcase.model.shared.Answer
|
||||
|
|
@ -12,6 +13,7 @@ import org.junit.jupiter.api.DisplayName
|
|||
import org.junit.jupiter.api.Test
|
||||
|
||||
@Suppress("TestFunctionName")
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
internal class AnswerUtilsKtTest {
|
||||
|
||||
@DisplayName("GIVEN network exception thrown WHEN wrapped into answer THEN answer error is returned")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue