I have a method that I have to test -
public class DateUtil {
public static Date getPreviousDate() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1);
return cal.getTime();
}
}
This code is part of Spring Boot.
The POM file is given below -
I want to try mocking it using PowerMockRunner (as mentioned in many resources online) But I cannot seem to import it into my test file.
I tried mocking Mockito but that is also throwing error