JMockit: Verifing a set of methods has not been called -


this question jmockit. know how verify specific method has not been called class, example:

new expectations() {{     writer.writestring(anystring); times = 0; }}; 

now, writer has bunch of methods called writestring, writeboolean, writearray, etc, , want verify none of them has been called. possible using kind regex/method name matching? thanks

you should able achieve fullverifications class. like:

@test public void mytest(@mocked final writer writer) {     codeundertest.dosomething(writer);      new fullverifications(writer) {{         // expected calls verified here.         // calls not expected cause "unexpected invocation" if detected.     }}; } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -