Skip to content

Commit 63826bf

Browse files
committed
Upgrade deprecation levels to ERROR
1 parent 3db9e21 commit 63826bf

File tree

3 files changed

+6
-42
lines changed

3 files changed

+6
-42
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ inline fun <reified T : Any> argumentCaptor(): KArgumentCaptor<T> = KArgumentCap
3232

3333
inline fun <reified T : Any> capture(captor: ArgumentCaptor<T>): T = captor.capture() ?: createInstance<T>()
3434

35-
@Deprecated("Use captor.capture() instead.", ReplaceWith("captor.capture()"))
35+
@Deprecated("Use captor.capture() instead.", ReplaceWith("captor.capture()"), DeprecationLevel.ERROR)
3636
inline fun <reified T : Any> capture(captor: KArgumentCaptor<T>): T = captor.capture()
3737

3838
class KArgumentCaptor<out T : Any>(private val captor: ArgumentCaptor<T>, private val tClass: KClass<T>) {
@@ -51,7 +51,7 @@ class KArgumentCaptor<out T : Any>(private val captor: ArgumentCaptor<T>, privat
5151
* Instead, use [argumentCaptor] in the traditional way, or use one of
5252
* [argThat], [argForWhich] or [check].
5353
*/
54-
@Deprecated("Use argumentCaptor() or argThat() instead.")
54+
@Deprecated("Use argumentCaptor() or argThat() instead.", ReplaceWith("check(consumer)"), DeprecationLevel.ERROR)
5555
inline fun <reified T : Any> capture(noinline consumer: (T) -> Unit): T {
5656
var times = 0
5757
return argThat { if (++times == 1) consumer.invoke(this); true }

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ fun verifyZeroInteractions(vararg mocks: Any) = Mockito.verifyZeroInteractions(*
130130
fun <T> whenever(methodCall: T): OngoingStubbing<T> = Mockito.`when`(methodCall)!!
131131
fun withSettings(): MockSettings = Mockito.withSettings()!!
132132

133-
@Deprecated("Use any() instead.", ReplaceWith("any()"))
133+
@Deprecated("Use any() instead.", ReplaceWith("any()"), DeprecationLevel.ERROR)
134134
inline fun <reified T : Any> anyCollection(): Collection<T> = any()
135135

136-
@Deprecated("Use any() instead.", ReplaceWith("any()"))
136+
@Deprecated("Use any() instead.", ReplaceWith("any()"), DeprecationLevel.ERROR)
137137
inline fun <reified T : Any> anyList(): List<T> = any()
138138

139-
@Deprecated("Use any() instead.", ReplaceWith("any()"))
139+
@Deprecated("Use any() instead.", ReplaceWith("any()"), DeprecationLevel.ERROR)
140140
inline fun <reified T : Any> anySet(): Set<T> = any()
141141

142-
@Deprecated("Use any() instead.", ReplaceWith("any()"))
142+
@Deprecated("Use any() instead.", ReplaceWith("any()"), DeprecationLevel.ERROR)
143143
inline fun <reified K : Any, reified V : Any> anyMap(): Map<K, V> = any()

mockito-kotlin/src/test/kotlin/MockitoTest.kt

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -73,42 +73,6 @@ class MockitoTest {
7373
}
7474
}
7575

76-
@Test
77-
fun anyCollectionOfClosed() {
78-
mock<Methods>().apply {
79-
closedCollection(listOf())
80-
verify(this).closedCollection(any())
81-
verify(this).closedCollection(anyCollection())
82-
}
83-
}
84-
85-
@Test
86-
fun anyListOfClosed() {
87-
mock<Methods>().apply {
88-
closedList(listOf())
89-
verify(this).closedList(any())
90-
verify(this).closedList(anyList())
91-
}
92-
}
93-
94-
@Test
95-
fun anyClosedStringMap() {
96-
mock<Methods>().apply {
97-
closedStringMap(mapOf())
98-
verify(this).closedStringMap(any())
99-
verify(this).closedStringMap(anyMap())
100-
}
101-
}
102-
103-
@Test
104-
fun anyClosedSet() {
105-
mock<Methods>().apply {
106-
closedSet(setOf())
107-
verify(this).closedSet(any())
108-
verify(this).closedSet(anySet())
109-
}
110-
}
111-
11276
@Test
11377
fun anyStringVararg() {
11478
mock<Methods>().apply {

0 commit comments

Comments
 (0)