Skip to content

Commit

Permalink
Merge pull request #12973 from wordpress-mobile/fix/update-kotlin-to-…
Browse files Browse the repository at this point in the history
…1.4.10

Update kotlin to 1.4.10
  • Loading branch information
malinajirka authored Nov 10, 2020
2 parents 1797c18 + 3554747 commit 0da07a0
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Delay
import kotlinx.coroutines.Dispatchers.Unconfined
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.runBlocking
import org.mockito.Mockito
Expand All @@ -24,7 +23,7 @@ fun <T : Any, R> KStubbing<T>.onBlocking(methodCall: suspend T.() -> R): Ongoing
return runBlocking { Mockito.`when`(mock.methodCall()) }
}

@ExperimentalCoroutinesApi val TEST_SCOPE = CoroutineScope(Unconfined)
val TEST_SCOPE = CoroutineScope(Unconfined)
@InternalCoroutinesApi val TEST_DISPATCHER: CoroutineDispatcher = TestDispatcher()

@InternalCoroutinesApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import com.nhaarman.mockitokotlin2.times
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.whenever
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.InternalCoroutinesApi
import org.assertj.core.api.Assertions.assertThat
import org.junit.Before
Expand Down Expand Up @@ -39,7 +38,6 @@ class PostListMainViewModelTest : BaseUnitTest() {
private lateinit var viewModel: PostListMainViewModel

@InternalCoroutinesApi
@UseExperimental(ExperimentalCoroutinesApi::class)
@Before
fun setUp() {
val prefs = mock<AppPrefsWrapper> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import com.nhaarman.mockitokotlin2.eq
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.whenever
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.flow.flowOf
import org.assertj.core.api.Assertions.assertThat
Expand Down Expand Up @@ -73,7 +72,6 @@ import org.wordpress.android.ui.utils.HtmlMessageUtils
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper
import org.wordpress.android.viewmodel.ResourceProvider

@ExperimentalCoroutinesApi
@InternalCoroutinesApi
@RunWith(MockitoJUnitRunner::class)
class ReaderPostCardActionsHandlerTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.lifecycle.Observer
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.whenever
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.InternalCoroutinesApi
import org.assertj.core.api.Assertions
import org.junit.Before
Expand Down Expand Up @@ -70,7 +69,6 @@ class ReaderDiscoverDataProviderTest {
)
}

@ExperimentalCoroutinesApi
@Test
fun `when refreshCards is requested started gets posted on comm channel`() = test {
whenever(fetchDiscoverCardsUseCase.fetch(REQUEST_FIRST_PAGE)).thenReturn(Started(REQUEST_FIRST_PAGE))
Expand All @@ -83,7 +81,6 @@ class ReaderDiscoverDataProviderTest {
.isEqualTo(Started(REQUEST_FIRST_PAGE))
}

@ExperimentalCoroutinesApi
@Test
fun `when fetch request fails then failure gets posted to comm channel`() = test {
// Arrange
Expand All @@ -97,7 +94,6 @@ class ReaderDiscoverDataProviderTest {
.isEqualTo(RemoteRequestFailure(REQUEST_FIRST_PAGE))
}

@ExperimentalCoroutinesApi
@Test
fun `when fetch request succeeds success gets posted to comm channel`() = test {
// Arrange
Expand All @@ -111,7 +107,6 @@ class ReaderDiscoverDataProviderTest {
.isEqualTo(Success(REQUEST_FIRST_PAGE))
}

@ExperimentalCoroutinesApi
@Test
fun `when fetch request unchanged success gets posted to comm channel`() = test {
// Arrange
Expand All @@ -125,7 +120,6 @@ class ReaderDiscoverDataProviderTest {
.isEqualTo(Success(REQUEST_FIRST_PAGE))
}

@ExperimentalCoroutinesApi
@Test
fun `on cards updated has new the data gets posted to discover feed`() = test {
// Arrange
Expand All @@ -143,7 +137,6 @@ class ReaderDiscoverDataProviderTest {
.isEqualTo(NUMBER_OF_ITEMS)
}

@ExperimentalCoroutinesApi
@Test
fun `when loadMoreRequest in progress another started not posted to comm channel`() = test {
whenever(fetchDiscoverCardsUseCase.fetch(REQUEST_MORE)).thenReturn(Started(REQUEST_MORE))
Expand All @@ -168,7 +161,6 @@ class ReaderDiscoverDataProviderTest {
}

// The following test the loadData(), which is kicked off when discoverFeed obtains observers
@ExperimentalCoroutinesApi
@Test
fun `when loadData with refresh request is started and posted to comm channel`() = test {
whenever(fetchDiscoverCardsUseCase.fetch(REQUEST_FIRST_PAGE)).thenReturn(Started(REQUEST_FIRST_PAGE))
Expand All @@ -182,7 +174,6 @@ class ReaderDiscoverDataProviderTest {
Assertions.assertThat(requireNotNull(started)).isEqualTo(Started(REQUEST_FIRST_PAGE))
}

@ExperimentalCoroutinesApi
@Test
fun `when loadData without refresh no start message posted to comm channel`() = test {
whenever(getDiscoverCardsUseCase.get()).thenReturn(createDummyReaderCardsList())
Expand All @@ -195,7 +186,6 @@ class ReaderDiscoverDataProviderTest {
Assertions.assertThat(started).isNull()
}

@ExperimentalCoroutinesApi
@Test
fun `when loadData with forceReload true data posted to discover channel`() = test {
whenever(getDiscoverCardsUseCase.get()).thenReturn(createDummyReaderCardsList())
Expand All @@ -211,7 +201,6 @@ class ReaderDiscoverDataProviderTest {
Assertions.assertThat(data).isNotNull
}

@ExperimentalCoroutinesApi
@Test
fun `when loadData with existsInMemory data posted to discover feed`() = test {
val discoverFeedObserver = Observer<ReaderDiscoverCards> { }
Expand Down Expand Up @@ -240,7 +229,6 @@ class ReaderDiscoverDataProviderTest {
Assertions.assertThat(data?.cards?.size).isEqualTo(NUMBER_OF_ITEMS)
}

@ExperimentalCoroutinesApi
@Test
fun `when followed tags change the discover feed gets refreshed`() = test {
// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.lifecycle.MutableLiveData
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.whenever
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.assertj.core.api.Assertions.assertThat
import org.junit.Before
import org.junit.Test
Expand Down Expand Up @@ -48,7 +47,6 @@ class StatsViewModelTest : BaseUnitTest() {
private lateinit var viewModel: StatsViewModel
private val _liveSelectedSection = MutableLiveData<StatsSection>()
private val liveSelectedSection: LiveData<StatsSection> = _liveSelectedSection
@ExperimentalCoroutinesApi
@Before
fun setUp() {
whenever(baseListUseCase.snackbarMessage).thenReturn(MutableLiveData())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.wordpress.android.ui.stats.refresh.lists

import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.assertj.core.api.Assertions.assertThat
import org.junit.Before
import org.junit.Test
Expand All @@ -18,7 +17,6 @@ import org.wordpress.android.util.NetworkUtilsWrapper
class UiModelMapperTest : BaseUnitTest() {
@Mock lateinit var networkUtilsWrapper: NetworkUtilsWrapper
private lateinit var mapper: UiModelMapper
@ExperimentalCoroutinesApi
@Before
fun setUp() {
mapper = UiModelMapper(networkUtilsWrapper)
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
buildscript {
ext.kotlinVersion = '1.3.61'
ext.serializationVersion = '0.14.0'
ext.kotlinVersion = '1.4.10'
ext.serializationVersion = '1.0-M1-1.4.0-rc'
ext.navComponentVersion = '2.0.0'
ext.kotlin_coroutines_version = '1.3.3'
ext.kotlin_coroutines_version = '1.3.9'
ext.coroutinesVersion = '1.3.9'
ext.kotlin_ktx_version = '1.2.0'
ext.androidx_work_version = "2.0.1"
ext.buildGutenbergMobileJSBundle = 1
Expand Down Expand Up @@ -125,7 +126,7 @@ ext {
minSdkVersion = 21
targetSdkVersion = 29

coroutinesVersion = '1.3.3'
coroutinesVersion = '1.3.9'
androidxWorkVersion = "2.0.1"

daggerVersion = '2.29.1'
Expand Down
4 changes: 2 additions & 2 deletions libs/WordPressAnnotations/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apply plugin: 'kotlin'

dependencies {
ext.kotlinVersion = '1.3.61'
ext.kotlinVersion = '1.4.10'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
}

sourceCompatibility = "7"
Expand Down
2 changes: 1 addition & 1 deletion libs/utils/WordPressUtils/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlinVersion = '1.3.61'
ext.kotlinVersion = '1.4.10'
ext.kotlin_ktx_version = '1.2.0'

repositories {
Expand Down

0 comments on commit 0da07a0

Please sign in to comment.