Mocking replaces an external dependency with a controlled stand-in, letting tests focus on business logic while checking how the dependency is used. section 6.3
Mocking student lookup
A test mocks the student store, expects get to run once, and returns either null or a valid student object. findStudent can then be tested without relying on a real database.




















