Mockito - 0 Matchers Expected, 1 Recorded (InvalidUseOfMatchersException)

前端 未结 3 505
离开以前
离开以前 2021-01-17 13:28

I\'m trying to mock up some mongo classes so that I don\'t need a connection (fairly standard stuff) but the following code gives me problems:

when(dbCollect         


        
3条回答
  •  旧时难觅i
    2021-01-17 13:39

    I think your results are compatible with the result that would happen if dbCollection is not a Mockito-mock (or your method is static or final). That would mean that a matcher is being used where none can be used; hence the "0 matchers expected, 1 recorded".

提交回复
热议问题