Concept Flow - @MockBean for mocking dependencies
Start Test
Spring Context Loads
@MockBean Creates Mock
Inject Mock into Context
Test Runs Using Mock
Verify Behavior or Output
Test Ends
The test starts by loading Spring context, then @MockBean creates a mock object and injects it into the context, replacing the real bean. The test runs using this mock, allowing controlled behavior and verification.