InterviewSolution
Saved Bookmarks
| 1. |
Can I Mock Static Methods? |
|
Answer» No. Mockito prefers OBJECT orientation and dependency injection over static, procedural code that is hard to understand & change. If you deal with scary LEGACY code you can use JMockit or POWERMOCK to mock static methods. No. Mockito prefers object orientation and dependency injection over static, procedural code that is hard to understand & change. If you deal with scary legacy code you can use JMockit or Powermock to mock static methods. |
|