Spring Boot TDD with Mockito TDD Cycle: Red → Green → Refactor Mockito Annotations | Annotation | Purpose | |------------|---------| | | Create mock object | | | Inject mocks into class under test | | | Partial mock - real methods + mock behavior | | | Capture arguments passed to mock | | | Mock bean in Spring context | Test Template Best Practices 1. One assertion per test - Focus on single behavior 2. Descriptive test names - Use 3. AAA Pattern - Arrange, Act, Assert 4. Test behavior, not implementation 5. Fast tests - Mock external dependencies 6. Isolated tests - No shared state ---