Issue#11 Add annotation @OptIn(ExperimentalCoroutinesApi::class) where its needed

This commit is contained in:
Gergely Hegedus 2022-01-23 23:21:16 +02:00
parent a71fa67de2
commit e9a22dd60a
14 changed files with 27 additions and 1 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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")