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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -