# 断言错误：测试 'shouldFail' 已禁用但仍被执行？

- **ID:** `java/junit-disabled-test-still-runs`
- **领域:** java
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

@Disabled 注解使用不当，或测试运行器因配置忽略 @Disabled。

## 版本兼容性

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

## 解决方案

1. **Ensure @Disabled is on test method or class** (95% 成功率)
   ```
   @Disabled("Reason")
@Test
void test() {
    // disabled
}
   ```
2. **Check build configuration for JUnit vintage engine** (80% 成功率)
   ```
   // Ensure no conflicting test runners
// Remove junit-vintage-engine if using JUnit 5 only
   ```

## 无效尝试

- **Removing @Disabled and commenting test** — Test becomes dead code; may be forgotten. (50% 失败率)
- **Using @Ignore instead (JUnit 4 style)** — JUnit 5 may not recognize @Ignore unless Jupiter API is used. (40% 失败率)
