PowerMockito Mocking whenNew not taking effect
Description: I cannot seem to have my stubs or mocks take affect in the class I have under test. I am trying to use the whenNew action so I can mock a return object and then mock a operation on that object with a returned value. I imagine its something simple I am missing but not seeing it. SOLUTION: Originally I was running with MockitoRunner.class and it required being changed to PowerMockRunner.class . Code below reflects the solution. Jars on the classpath: powermock-mockito-1.4.11-full.jar mockoito-all-1.9.0.jar javassist-3.15.0-GA.jar junit-4.8.2.jaf objensis-1.2.jar cglib-nodep-2.2.2