How to write tests (with Spring)
Why do we write test?
- We want to know that our code works
- We want to go faster (less debugging, knows that our code keeps working, ...)
How do we do this?
- Expressive, Readable, Reveal intention, ...
- Fast
Parts:
- Naming Methods
- ValueObjects
- Use Assertj
- Test Builders/Creating test objects - fragile tests
- Pure functions
- Adapter - Onion architecture
- Extensions
- Spring
- Spring Context Caching
- MockBean
- Stubs
- Annotations / Profiles
Great videos to watch on this topic