views:

80

answers:

1

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-jmstemplate-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()?

+1  A: 

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

ColinD
Yep, that's what I was looking for.verify(jmsTemplate, times(1)).send(Matchers.<MessageCreator>anyObject());
Rob