From bill-billing-unit-test-reviewer
Use PROACTIVELY when reviewing unit test code quality, discussing test design, or evaluating test coverage for Java/Spring Boot projects.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bill-billing-unit-test-reviewer:review-testsonnetThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Review unit test code to ensure quality meets senior developer standards.
Review unit test code to ensure quality meets senior developer standards.
Most Important: All test scenarios must be based on real system behavior. Never fabricate hypothetical scenarios.
// Bad: Assuming exception is thrown without checking source code
@Test
void shouldThrowIllegalArgumentException() {
assertThrows(IllegalArgumentException.class, () -> facade.process(null));
}
// Good: Verified AcFacade.java:45 actually throws TokenInvalidException
@Test
@DisplayName("當Token無效時_應該拋出TokenInvalidException")
void shouldThrowTokenInvalidExceptionWhenTokenIsInvalid() {
assertThrows(TokenInvalidException.class, () -> facade.process(invalidToken));
}
createTestOrder(DEFAULT_USER, DEFAULT_ITEMS, DEFAULT_AMOUNT) — just write new Order(userId, items, amount) inlineextends AbstractServiceTest<Order, OrderRepository> — just class OrderServiceTest { ... }| Layer | Should Test | Should NOT Test |
|---|---|---|
| Model | Bean Validation (@NotBlank, @Size, etc.) | — |
| Controller | HTTP behavior, status codes, JSON serialization | Duplicate validation rules |
| Service | Business logic, state changes | Database operation details |
@DisplayName in Traditional Chinese: "當訂單金額超過限制時_應該拋出例外"@Nested for logical groupingshould_expectedBehavior_when_condition()Prefer state verification over interaction verification:
// Good: State verification
assertThat(order.getStatus()).isEqualTo(OrderStatus.PENDING);
// Use interaction verification only when state cannot be asserted
verify(emailService).sendOrderCompletionEmail(orderId);
@DisplayName in Traditional Chinese@Nested for organizationIMPORTANT: All output must be in Traditional Chinese (繁體中文)
when(service.voidMethod()).thenReturn(...) 會編譯錯誤。void method 要用 doNothing().when(service).voidMethod()@ExtendWith(MockitoExtension.class),@SpringBootTest 載入整個 ApplicationContext 很慢verify(service, times(1)).method()npx claudepluginhub xinqilin/claude-dev-toolkit-marketplace --plugin bill-billing-unit-test-reviewerEnforces test quality principles including Arrange-Act-Assert structure, single behavior per test, and meaningful naming when writing or reviewing test code.
Test Java applications - JUnit 5, Mockito, integration testing, TDD patterns
Generates JUnit 5 unit tests with Mockito and Testcontainers integration tests for Java services, repositories, controllers, and utilities. Auto-detects Maven/Gradle/Spring Boot setup from build files.