# 参数捕获器异常：ArgumentCaptor 的 capture() 方法从未被调用

- **ID:** `java/mockito-argumentcaptor-not-invoked`
- **领域:** java
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

使用了 ArgumentCaptor，但未验证方法是否实际使用捕获的参数被调用。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 8+ | active | — | — |

## 解决方案

1. **Use verify with captor** (95% 成功率)
   ```
   ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
verify(mock).method(captor.capture());
assertEquals("expected", captor.getValue());
   ```
2. **Use @Captor annotation** (90% 成功率)
   ```
   @Captor
ArgumentCaptor<String> captor;

verify(mock).method(captor.capture());
   ```

## 无效尝试

- **Calling captor.getValue() without verify** — Capture only happens during verification, so value is null. (90% 失败率)
- **Using captor.capture() in when() instead of verify()** — capture() is for verification, not stubbing. (70% 失败率)
