java - expect static call with some certain result -
java - expect static call with some certain result -
i've got static phone call of scheme function in method
long currentdatemilliseconds = system.currenttimemillis();
how test phone call , set specific result using powermock?
i mean this
system.currenttimemillis(); expectlastcall().andreturn(leftbound); // expect homecoming amount of milliseconds
well...i've done this
mockstatic(system.class); expect(system.currenttimemillis()).andreturn(rightbound.gettime()); replayall(); asserttrue(dateutils.isinrange(leftbound, rightbound)); verifyall();
java powermock
Comments
Post a Comment