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
Post a Comment