For a deeper dive check out the AssertJ docs
- Definition of ‘Koan’
- What is this all about?
- Group Learning
- Current Lessons
- Getting Started
- Tips & Tricks
Kōan is a zen word meaning the enlightenment or awakening of a person, usually through a puzzle or riddle. The most common one is "What is the sound of one hand clapping?"
AssertJ is a fluent assertions library to help with writing more expressive tests. AssertJ produces better error messages and a lot more functionality than standard JUnit assertions.
These Koans are an interactive and fun way to be introduced to and learn how to test with AssertJ.
- Basic Assertions
- Collection Assertions
- Exception Assertions
- BDDAssertions
- Custom Assertions
Clone the repo and open it up in your preferred IDE.
Run the unit test, see it fail, then fill in the blank ("____"). Run it again to see it pass.
- Play: Experimentation is a powerful learning tool. Don't be afraid to try stuff out, and run it to see what happens.
- Run the Test: It is valuable to see what the results are. All Koans are designed to produce something even before they are filled in.
- Debug: Set some break point and walk through the code. It's a great way to get details. ({"Ctrl+R, Ctrl+T"}) will run in debug mode.
- Do Them with a Friend: Learning is more fun and less frustrating when you have a friend with you.
- Retrospect after each Koan: True insight comes from reflecting on the answer, not just obtaining it.