开发者

Can a method call with an anonymous inner class as an argument be verified with mockito?

I suspect this isn't possible as the anonymous inner class is private. Can I verify that the method was called without worrying about the argument?

I'm tying to test this: http://bsnyderblog.blogspot.com/2010/02/using-spring-j开发者_开发问答mstemplate-to-send-jms.html

With something like:

verify(jmsTemplate, times(1)).send();

But send() needs an argument.

Is there some other way to unit test sendMessages()?


Can you just do verify(jmsTemplate, times(1)).send(anyObject())?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜