diff --git a/.travis.yml b/.travis.yml index 3d8ed773..0ee6174b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,12 +10,16 @@ matrix: env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.1.61 - jdk: oraclejdk8 env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.2.50 + - jdk: oraclejdk8 + env: TERM=dumb MOCK_MAKER=mock-maker-inline KOTLIN_VERSION=1.3.0-rc-116 - jdk: oraclejdk8 env: TERM=dumb KOTLIN_VERSION=1.0.7 - jdk: oraclejdk8 env: TERM=dumb KOTLIN_VERSION=1.1.61 - jdk: oraclejdk8 env: TERM=dumb KOTLIN_VERSION=1.2.50 + - jdk: oraclejdk8 + env: TERM=dumb KOTLIN_VERSION=1.3.0-rc-116 env: diff --git a/mockito-kotlin/build.gradle b/mockito-kotlin/build.gradle index 6392e678..b3229fb7 100644 --- a/mockito-kotlin/build.gradle +++ b/mockito-kotlin/build.gradle @@ -3,11 +3,12 @@ apply from: '../publishing.gradle' apply plugin: 'org.jetbrains.dokka' buildscript { - ext.kotlin_version = "1.2.50" + ext.kotlin_version = "1.3.0-rc-146" repositories { mavenCentral() jcenter() + maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' } } dependencies { @@ -21,21 +22,22 @@ buildscript { repositories { mavenCentral() jcenter() + maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' } } dependencies { compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.23.3' + compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.0-eap13' - compile "org.mockito:mockito-core:2.21.0" + compile "org.mockito:mockito-core:2.23.0" testCompile 'junit:junit:4.12' testCompile 'com.nhaarman:expect.kt:1.0.0' testCompile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testCompile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.23.3' + testCompile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.0-eap13' - testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.23.3" + testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.30.0-eap13" } dokka { @@ -49,10 +51,3 @@ dokka { } } javadoc.dependsOn dokka - - -kotlin { - experimental { - coroutines "enable" - } -} diff --git a/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/KStubbing.kt b/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/KStubbing.kt index 14e68e1e..48442400 100644 --- a/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/KStubbing.kt +++ b/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/KStubbing.kt @@ -26,7 +26,7 @@ package com.nhaarman.mockitokotlin2 import com.nhaarman.mockitokotlin2.internal.createInstance -import kotlinx.coroutines.experimental.runBlocking +import kotlinx.coroutines.runBlocking import org.mockito.Mockito import org.mockito.stubbing.OngoingStubbing import kotlin.reflect.KClass diff --git a/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/Verification.kt b/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/Verification.kt index 3453d37f..bbc86250 100644 --- a/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/Verification.kt +++ b/mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/Verification.kt @@ -26,7 +26,7 @@ package com.nhaarman.mockitokotlin2 import com.nhaarman.mockitokotlin2.internal.createInstance -import kotlinx.coroutines.experimental.runBlocking +import kotlinx.coroutines.runBlocking import org.mockito.InOrder import org.mockito.Mockito import org.mockito.verification.VerificationAfterDelay diff --git a/mockito-kotlin/src/test/kotlin/test/CoroutinesTest.kt b/mockito-kotlin/src/test/kotlin/test/CoroutinesTest.kt index 8f593035..8f679042 100644 --- a/mockito-kotlin/src/test/kotlin/test/CoroutinesTest.kt +++ b/mockito-kotlin/src/test/kotlin/test/CoroutinesTest.kt @@ -4,10 +4,10 @@ package test import com.nhaarman.expect.expect import com.nhaarman.mockitokotlin2.* -import kotlinx.coroutines.experimental.CommonPool -import kotlinx.coroutines.experimental.delay -import kotlinx.coroutines.experimental.runBlocking -import kotlinx.coroutines.experimental.withContext +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.runBlocking +import kotlinx.coroutines.withContext import org.junit.Test @@ -139,7 +139,7 @@ class CoroutinesTest { @Test fun verifySuspendMethod() = runBlocking { - val testSubject : SomeInterface = mock() + val testSubject: SomeInterface = mock() testSubject.suspending() @@ -157,9 +157,9 @@ interface SomeInterface { class SomeClass { - suspend fun result(r: Int) = withContext(CommonPool) { r } + suspend fun result(r: Int) = withContext(Dispatchers.Default) { r } - suspend fun delaying() = withContext(CommonPool) { + suspend fun delaying() = withContext(Dispatchers.Default) { delay(100) 42 } diff --git a/tests/build.gradle b/tests/build.gradle index 3da55c12..70c6c27c 100644 --- a/tests/build.gradle +++ b/tests/build.gradle @@ -1,9 +1,10 @@ buildscript { - ext.kotlin_version = '1.2.50' ext.kotlin_version = System.getenv("KOTLIN_VERSION") ?: '1.0.7' + ext.kotlin_version = '1.3.0-rc-116' repositories { mavenCentral() + maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -16,6 +17,7 @@ apply plugin: 'kotlin' repositories { mavenCentral() jcenter() + maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' } } dependencies {