Let's say I have the following class:
class MyClass {
public MyClass(){
}
public void hello() {
System.out.println("hello");
}
}
and I want to test 'hello' method:
@Test
public void testHello() {
MyClass mc = new MyClass();
mc.hello();
}
Now, I want to spy System.out.println and make sure that this method was called with "hello" as argument. How do I do it?