Setting private fields of a class for unit testing

In this post under Powermock, I will with example show how to set private fields of a class for unit testing. For example, consider you have a class as shown below to be tested Class To Be Tested package package5; import java.util.Date; import java.util.Random; public class Example5 { private Random random = new Random(); public…… Continue reading Setting private fields of a class for unit testing