Stubbing final methods

This post explains how to stub a final method. The class to be tested is as shown below Class1 package package5; public class Class1 { public final int method1(int value) { return value * value; } } The test class is as shown below Test Class 1 package package5; 2 3 import org.junit.Before; 4 import…… Continue reading Stubbing final methods