title: Junit to test if the method call is made
body: <p>I've a transaction class with a validate method. There is a condition in the method that when satisfied will not be calling an alert notification method, which, on the other hand, will only be called when the check condition failed (if condition is false, call the alert and notify the user).
  I want to test with a JUnit, if that alert method get's called or not. Could someone advise how to proceed, as I'm new to JUnits.</p>