MyObj myObj = createMock(MyObj.class);
// . . . .
verify (myObj, never()).someMethod();
But what if all the methods in a class are static? Do you treat that
the same as a "normal" class? Or is it done separately if you do a
mockStatic() on the class?
mockStatic(MyStaticObject.class);
// . . . .
verify (MyStaticObject.someMethod(), never());
??? This must not be the correct approach as it's not working for
me. How does the syntax differ?
Thanks.
Oh, just as a postscript: Is there any way to verify that an exception
was thrown and caught in the tested code?
Hope that helps,verifyStatic(never());MyStaticObject.someMethod();
--
You received this message because you are subscribed to the Google Groups "PowerMock" group.
To post to this group, send email to powe...@googlegroups.com.
To unsubscribe from this group, send email to powermock+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/powermock?hl=en.
I find that Eclipse is redlining the verifyStatic(), so I assume that
there's something I'm missing in the imports. What's the proper import
statement to bring this in?
Thanks.
Craig
On Nov 30, 7:37 am, Johan Haleby <johan.hal...@gmail.com> wrote:
> Hi,
>
> The documentation<http://code.google.com/p/powermock/wiki/MockitoUsage13#A_full_example...>says
It's located in the PowerMockito class, i.e. PowerMockito.verifyStatic(); /Johan On 11/30/2011 06:17 PM, CraigA wrote