Skip to content

Commit

Permalink
Merge pull request #295 from nhaarman/kotlin-1.3
Browse files Browse the repository at this point in the history
Migrating to Kotlin 1.3
  • Loading branch information
nhaarman authored Oct 9, 2018
2 parents a67fb80 + 7444d1d commit 3139a2c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 7 additions & 12 deletions mockito-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -49,10 +51,3 @@ dokka {
}
}
javadoc.dependsOn dokka


kotlin {
experimental {
coroutines "enable"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions mockito-kotlin/src/test/kotlin/test/CoroutinesTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -139,7 +139,7 @@ class CoroutinesTest {

@Test
fun verifySuspendMethod() = runBlocking {
val testSubject : SomeInterface = mock()
val testSubject: SomeInterface = mock()

testSubject.suspending()

Expand All @@ -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
}
Expand Down
4 changes: 3 additions & 1 deletion tests/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -16,6 +17,7 @@ apply plugin: 'kotlin'
repositories {
mavenCentral()
jcenter()
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' }
}

dependencies {
Expand Down

0 comments on commit 3139a2c

Please sign in to comment.