开发者

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

开发者 https://www.devze.com 2023-01-02 04:51 出处:网络
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 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

精彩评论

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