HubTurbo / addressbook

A small app for training and experimentation
Other
1 stars 3 forks source link

Add tests for UpdateManager #556 #558

Closed m133225 closed 8 years ago

m133225 commented 8 years ago

Fixes #556

m133225 commented 8 years ago

Can't seem to figure out how to consecutively stub static void methods. e.g. doNothing().doThrow(throwable).when(Class, "staticVoidMethodName", arguments) doesn't work since PowerMockitoStubber's doThrow() returns a generic Stubber.

Required for simulating failed downloading of updates since first time it uses FileUtil.writeStreamToFile for downloading the version data, and uses it again for the updates download