Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

2 votes
0 answers
6k views

How to mock private methods using Whitebox(org.powermock.reflect)

I want to mock a private method which has been called inside another method. Following is the sample code, I have written. Java code: package org.mockprivatemethods; public class AccountDeposit ...
S Kumar's user avatar
  • 585
0 votes
1 answer
2k views

Undoing Whitebox.setInternalState in a @AfterMethod without setting original state

I have a class which I cannot easily use a dependency injection to mock due to an obligatory implementation of an interface - in a nutshell, for that reason I will be using Whitebox and my concern ...
Fernando Barbeiro's user avatar