Tag Archives: mock

Using PowerMock to mock a call to super

Let’s say you are wanting to test UberEmployee below: [java] public class Employee { public int calculatePay() { return someComplexCalculations; } } public class UberEmployee { public static final long UBER_BONUS = 1000; @Override public int calculatePay() { return super.calculatePay() + 1000; } } [/java] Perhaps you can’t change Employee but you still want to… Read More »