mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-12 03:03:23 +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:
@@ -357,9 +357,10 @@ mvn jacoco:check
|
||||
- 异常场景使用`assertThrows`并验证消息
|
||||
|
||||
### 断言
|
||||
- **始终使用AssertJ**(`assertThat`)代替JUnit断言
|
||||
- 值检查**优先使用AssertJ**(`assertThat`)而非JUnit断言
|
||||
- 使用流式AssertJ API提高可读性
|
||||
- 异常断言: `assertThatThrownBy(() -> ...).isInstanceOf(...).hasMessageContaining(...)`
|
||||
- 异常: 使用JUnit `assertThrows`捕获,再用AssertJ验证消息
|
||||
- 成功路径: 使用JUnit `assertDoesNotThrow`
|
||||
|
||||
### 事件驱动测试
|
||||
- 使用`AdviceWith`和`MockEndpoint`测试Camel路由
|
||||
|
||||
Reference in New Issue
Block a user