Mockito - 0 Matchers Expected, 1 Recorded (InvalidUseOfMatchersException)

前端 未结 3 515
离开以前
离开以前 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条回答
  •  盖世英雄少女心
    2021-01-17 13:56

    This same issue can be reproduced in Scala if you have default arguments. It may look like you're providing any() for every argument, but you should verify that the method definition doesn't have any default parameters which might be messing things up.

提交回复
热议问题