Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename packages to org.mockito.kotlin #410

Merged
merged 1 commit into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Mockito-Kotlin
[ ![Download](https://maven-badges.herokuapp.com/maven-central/com.nhaarman.mockitokotlin2/mockito-kotlin/badge.svg) ](https://maven-badges.herokuapp.com/maven-central/com.nhaarman.mockitokotlin2/mockito-kotlin)
[ ![Download](https://maven-badges.herokuapp.com/maven-central/org.mockito/mockito-kotlin/badge.svg) ](https://maven-badges.herokuapp.com/maven-central/org.mockito/mockito-kotlin)

A small library that provides helper functions to work with [Mockito](https://github.com/mockito/mockito) in Kotlin.

Expand All @@ -9,7 +9,7 @@ Mockito-Kotlin is available on Maven Central and JCenter.
For Gradle users, add the following to your `build.gradle`, replacing `x.x.x` with the latest version:

```groovy
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:x.x.x"
testImplementation "org.mockito:mockito-kotlin:x.x.x"
```

## Example
Expand All @@ -33,7 +33,7 @@ fun doAction_doesSomething(){
}
```

For more info and samples, see the [Wiki](https://github.com/nhaarman/mockito-kotlin/wiki).
For more info and samples, see the [Wiki](https://github.com/mockito/mockito-kotlin/wiki).

## Building

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

import com.nhaarman.mockitokotlin2.internal.createInstance
import org.mockito.kotlin.internal.createInstance
import org.mockito.ArgumentCaptor
import kotlin.reflect.KClass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

import org.mockito.BDDMockito
import org.mockito.BDDMockito.BDDMyOngoingStubbing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

import com.nhaarman.mockitokotlin2.internal.createInstance
import org.mockito.kotlin.internal.createInstance
import kotlinx.coroutines.runBlocking
import org.mockito.Mockito
import org.mockito.stubbing.OngoingStubbing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

import com.nhaarman.mockitokotlin2.internal.createInstance
import org.mockito.kotlin.internal.createInstance
import org.mockito.ArgumentMatcher
import org.mockito.Mockito

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

import org.mockito.Incubating
import org.mockito.MockSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

import org.mockito.MockingDetails
import org.mockito.Mockito
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

class MockitoKotlinException(message: String?, cause: Throwable?) : RuntimeException(message, cause)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

import org.mockito.Mockito
import org.mockito.invocation.InvocationOnMock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

import org.mockito.Mockito

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

import org.mockito.Mockito
import org.mockito.invocation.InvocationOnMock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin

import com.nhaarman.mockitokotlin2.internal.createInstance
import org.mockito.kotlin.internal.createInstance
import kotlinx.coroutines.runBlocking
import org.mockito.InOrder
import org.mockito.Mockito
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2
package org.mockito.kotlin


/**
Expand All @@ -43,6 +43,6 @@ inline fun <T> verify(mock: T, block: VerifyScope<T>.() -> Unit) {
class VerifyScope<out T>(val mock: T) {

operator inline fun Int.times(call: T.() -> Unit) {
verify(mock, com.nhaarman.mockitokotlin2.times(this)).call()
verify(mock, org.mockito.kotlin.times(this)).call()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* THE SOFTWARE.
*/

package com.nhaarman.mockitokotlin2.internal
package org.mockito.kotlin.internal

import kotlin.reflect.KClass
import java.lang.reflect.Array as JavaArray
Expand Down
2 changes: 1 addition & 1 deletion mockito-kotlin/src/test/kotlin/test/CoroutinesTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
package test

import com.nhaarman.expect.expect
import com.nhaarman.mockitokotlin2.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import org.junit.Test
import org.mockito.kotlin.*


class CoroutinesTest {
Expand Down
2 changes: 1 addition & 1 deletion tests/src/test/kotlin/test/ArgumentCaptorTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package test

import com.nhaarman.expect.expect
import com.nhaarman.expect.expectErrorWithMessage
import com.nhaarman.mockitokotlin2.*
import org.junit.Test
import org.mockito.kotlin.*
import java.util.*

class ArgumentCaptorTest : TestBase() {
Expand Down
4 changes: 2 additions & 2 deletions tests/src/test/kotlin/test/BDDMockitoTest.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package test

import com.nhaarman.expect.expect
import com.nhaarman.mockitokotlin2.*
import org.junit.Test
import org.mockito.kotlin.*
import org.mockito.stubbing.Answer

class BDDMockitoTest {
Expand Down Expand Up @@ -126,6 +126,6 @@ class BDDMockitoTest {
mock.stringResult()

/* Then */
then(mock).should().stringResult()
org.mockito.kotlin.then(mock).should().stringResult()
}
}
4 changes: 2 additions & 2 deletions tests/src/test/kotlin/test/EqTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ package test
*/

import com.nhaarman.expect.expect
import com.nhaarman.mockitokotlin2.eq
import com.nhaarman.mockitokotlin2.mock
import org.mockito.kotlin.eq
import org.mockito.kotlin.mock
import org.junit.After
import org.junit.Before
import org.junit.Test
Expand Down
3 changes: 2 additions & 1 deletion tests/src/test/kotlin/test/MatchersTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package test

import com.nhaarman.expect.expect
import com.nhaarman.expect.expectErrorWithMessage
import com.nhaarman.mockitokotlin2.*
import org.junit.Test
import org.mockito.ArgumentMatcher
import org.mockito.internal.matchers.VarargMatcher
import org.mockito.invocation.InvocationOnMock
import org.mockito.kotlin.*
import org.mockito.stubbing.Answer
import java.io.IOException
import kotlin.check

class MatchersTest : TestBase() {

Expand Down
12 changes: 6 additions & 6 deletions tests/src/test/kotlin/test/MockingTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package test
import com.nhaarman.expect.expect
import com.nhaarman.expect.expectErrorWithMessage
import com.nhaarman.expect.fail
import com.nhaarman.mockitokotlin2.UseConstructor.Companion.parameterless
import com.nhaarman.mockitokotlin2.UseConstructor.Companion.withArguments
import com.nhaarman.mockitokotlin2.doReturn
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.verify
import com.nhaarman.mockitokotlin2.whenever
import org.mockito.kotlin.UseConstructor.Companion.parameterless
import org.mockito.kotlin.UseConstructor.Companion.withArguments
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
import org.junit.Test
import org.mockito.Mockito
import org.mockito.exceptions.verification.WantedButNotInvoked
Expand Down
3 changes: 2 additions & 1 deletion tests/src/test/kotlin/test/OngoingStubbingTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package test
import com.nhaarman.expect.expect
import com.nhaarman.expect.expectErrorWithMessage
import com.nhaarman.expect.fail
import com.nhaarman.mockitokotlin2.*
import org.junit.Assume.assumeFalse
import org.junit.Test
import org.mockito.Mockito
import org.mockito.exceptions.misusing.UnfinishedStubbingException
import org.mockito.kotlin.*
import org.mockito.stubbing.Answer
import kotlin.check

class OngoingStubbingTest : TestBase() {

Expand Down
2 changes: 1 addition & 1 deletion tests/src/test/kotlin/test/SpyTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ package test
*/

import com.nhaarman.expect.expect
import com.nhaarman.mockitokotlin2.*
import org.junit.After
import org.junit.Test
import org.mockito.Mockito
import org.mockito.kotlin.*
import java.util.*

class SpyTest : TestBase() {
Expand Down
2 changes: 1 addition & 1 deletion tests/src/test/kotlin/test/StubberTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package test

import com.nhaarman.expect.expect
import com.nhaarman.expect.expectErrorWithMessage
import com.nhaarman.mockitokotlin2.*
import org.junit.Test
import org.mockito.kotlin.*

class StubberTest : TestBase() {

Expand Down
3 changes: 2 additions & 1 deletion tests/src/test/kotlin/test/VerificationTest.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package test

import com.nhaarman.expect.expect
import com.nhaarman.mockitokotlin2.*
import org.junit.Test
import org.mockito.exceptions.base.MockitoAssertionError
import org.mockito.kotlin.*
import org.mockito.kotlin.verify

class VerificationTest : TestBase() {

Expand Down
6 changes: 3 additions & 3 deletions tests/src/test/kotlin/test/VerifyTest.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package test

import com.nhaarman.mockitokotlin2.any
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.verify
import org.mockito.kotlin.any
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
import org.junit.Test
import org.mockito.exceptions.verification.TooLittleActualInvocations
import org.mockito.exceptions.verification.junit.ArgumentsAreDifferent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package test.createinstance

import com.nhaarman.expect.expect
import com.nhaarman.mockitokotlin2.internal.createInstance
import org.mockito.kotlin.internal.createInstance
import org.junit.Test
import test.TestBase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
*/

import com.nhaarman.expect.expect
import com.nhaarman.mockitokotlin2.*
import org.junit.Assume.assumeTrue
import org.junit.Before
import org.junit.Test
import org.mockito.kotlin.*
import test.mockMakerInlineEnabled
import java.io.IOException
import java.math.BigInteger
Expand Down