Skip to content

Commit 559ffc5

Browse files
committed
Remove deprecated methods
1 parent dc4ab0a commit 559ffc5

File tree

3 files changed

+1
-32
lines changed

3 files changed

+1
-32
lines changed

mockito-kotlin/src/main/kotlin/com/nhaarman/mockito_kotlin/ArgumentCaptor.kt

-19
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ inline fun <reified T : Any> capture(captor: ArgumentCaptor<T>): T = captor.capt
3636

3737
class KArgumentCaptor<out T : Any?>(private val captor: ArgumentCaptor<T>, private val tClass: KClass<*>) {
3838

39-
@Deprecated("Use lastValue", ReplaceWith("lastValue"))
40-
val value: T
41-
get() = captor.value
42-
4339
/**
4440
* The first captured value of the argument.
4541
* @throws IndexOutOfBoundsException if the value is not available.
@@ -86,18 +82,3 @@ val <T> ArgumentCaptor<T>.thirdValue: T
8682

8783
val <T> ArgumentCaptor<T>.lastValue: T
8884
get() = allValues.last()
89-
90-
/**
91-
* This method is deprecated because its behavior differs from the Java behavior.
92-
* Instead, use [argumentCaptor] in the traditional way, or use one of
93-
* [argThat], [argForWhich] or [check].
94-
*/
95-
@Deprecated("Use argumentCaptor(), argThat() or check() instead.", ReplaceWith("check(consumer)"), DeprecationLevel.ERROR)
96-
inline fun <reified T : Any> capture(noinline consumer: (T) -> Unit): T {
97-
var times = 0
98-
return argThat { if (++times == 1) consumer.invoke(this); true }
99-
}
100-
101-
@Deprecated("Use captor.capture() instead.", ReplaceWith("captor.capture()"), DeprecationLevel.ERROR)
102-
inline fun <reified T : Any> capture(captor: KArgumentCaptor<T>): T = captor.capture()
103-

mockito-kotlin/src/main/kotlin/com/nhaarman/mockito_kotlin/Mockito.kt

-12
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,3 @@ fun verifyZeroInteractions(vararg mocks: Any) = Mockito.verifyZeroInteractions(*
156156

157157
fun <T> whenever(methodCall: T): OngoingStubbing<T> = Mockito.`when`(methodCall)!!
158158
fun withSettings(): MockSettings = Mockito.withSettings()!!
159-
160-
@Deprecated("Use any() instead.", ReplaceWith("any()"), DeprecationLevel.ERROR)
161-
inline fun <reified T : Any> anyCollection(): Collection<T> = any()
162-
163-
@Deprecated("Use any() instead.", ReplaceWith("any()"), DeprecationLevel.ERROR)
164-
inline fun <reified T : Any> anyList(): List<T> = any()
165-
166-
@Deprecated("Use any() instead.", ReplaceWith("any()"), DeprecationLevel.ERROR)
167-
inline fun <reified T : Any> anySet(): Set<T> = any()
168-
169-
@Deprecated("Use any() instead.", ReplaceWith("any()"), DeprecationLevel.ERROR)
170-
inline fun <reified K : Any, reified V : Any> anyMap(): Map<K, V> = any()

mockito-kotlin/src/test/kotlin/test/createinstance/NullCasterTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ class NullCasterTest : TestBase() {
2828
acceptNonNullableString(s)
2929
}
3030

31-
private fun acceptNonNullableString(s: String) {
31+
private fun acceptNonNullableString(@Suppress("UNUSED_PARAMETER") s: String) {
3232
}
3333
}

0 commit comments

Comments
 (0)