0
Я хочу, чтобы мой макет, чтобы быть в состоянии обрабатывать любой вход для методаInvalidUseOfMatchersException, когда я передаю любую строку для моего макете параметра
val redis = mock[RedisClient]
when(redis.scard(any[String])).thenReturn(Some("hello"))
Ошибка:
org.mockito.exceptions.misusing.InvalidUseOfMatchersException: Invalid use of argument matchers!
[info] 2 matchers expected, 1 recorded:
[info] -> at ..(SomeSpec.scala:123)
[info]
[info] This exception may occur if matchers are combined with raw values:
[info] //incorrect:
[info] someMethod(anyObject(), "raw String");