Mocking…
Arrange:
Mocking makes entire functionality lost. It is training your mock by stubbing all the external dependencies with a given dummy input/expected output; when():thenReturns; throws exceptions. What remains are lines of code in the if/else branches that are executed by the type of input.
Action:
Calling the class under test’s (CUT) actual method in question.
Assert:
Use Assertions for booleans; throws for expected exception.
Spying…
Verify for number of times a method is actually called or should have never called. It takes into account number of times; the status is tracked; so it is stateful.
Submit your review | |
Average rating: 0 reviews