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

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -