I need to mock a static method of a class which is also void. So, lets say if my class is.
class Util{
public static void test(){}
}
and my Action class which calls Util's method
class Action{
public void update(){
Util.test();
}
}
My test class is:
class Test{
Action action=new Action();
action.update();
//want to
}
My question is how can I mock a class and verify if its method gets called Util.test(); how can I put something like:
given(Util.test());//in this case I cannot put willReturn as this has type void