mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-11 02:33:10 +08:00
fix: clarify AssertJ vs JUnit assertion guidance in quarkus-tdd
Changed "Always use AssertJ" to "Prefer AssertJ for value checks" and documented the intended pattern: JUnit assertThrows/assertDoesNotThrow for exception lifecycle, AssertJ for value validation. This matches the actual code examples in the document.
This commit is contained in:
@@ -861,9 +861,10 @@ mvn jacoco:check
|
||||
- Aim for 80%+ line coverage, 70%+ branch coverage
|
||||
|
||||
### Assertions
|
||||
- **Always use AssertJ** (`assertThat`) instead of JUnit assertions
|
||||
- **Prefer AssertJ** (`assertThat`) over JUnit assertions for value checks
|
||||
- Use fluent AssertJ API for readability: `assertThat(list).hasSize(3).contains(item)`
|
||||
- For exceptions: `assertThatThrownBy(() -> ...).isInstanceOf(...).hasMessageContaining(...)`
|
||||
- For exceptions: use JUnit `assertThrows` to capture, then AssertJ to validate the message
|
||||
- For non-throwing success paths: use JUnit `assertDoesNotThrow`
|
||||
- For collections: `extracting()`, `filteredOn()`, `containsExactly()`
|
||||
|
||||
### Testing Integration
|
||||
|
||||
Reference in New Issue
Block a user