Skip to content

Commit ffaddbb

Browse files
committed
Add reified support for refEq like other matchers
1 parent efccc0b commit ffaddbb

File tree

1 file changed

+2
-2
lines changed
  • mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2

1 file changed

+2
-2
lines changed

mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/Matchers.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fun <T : Any> notNull(): T? {
133133
* Object argument that is reflection-equal to the given value with support for excluding
134134
* selected fields from a class.
135135
*/
136-
fun <T> refEq(value: T, vararg excludeFields: String): T? {
137-
return Mockito.refEq(value, *excludeFields)
136+
inline fun <reified T : Any> refEq(value: T, vararg excludeFields: String): T {
137+
return Mockito.refEq<T>(value, *excludeFields) ?: createInstance()
138138
}
139139

0 commit comments

Comments
 (0)