Start here. This is the direct spoken answer to practice first.
Overview
A Spring bean override changes the application context; it should remove one irrelevant dependency, not hollow out the system.
I override a bean with a mock when the test needs a Spring context but a specific collaborator is outside the boundary, such as a paid external API or nondeterministic notification gateway. Current Spring test support can register a Mockito bean override, while older Boot suites may use @MockBean. I stub only behavior required by the scenario and assert the public result of the component under test.