testing
JUnit and WebMvcTest patterns for the Spring MVC demo. Use when writing any new test or adding coverage.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
JUnit and WebMvcTest patterns for the Spring MVC demo. Use when writing any new test or adding coverage.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Team quality gate as executable instruction. Use when reviewing completed work before merge, or when processing PR review comments received from other reviewers.
Generate well-formed user stories from technical context. Use when generating or improving story descriptions for an issue tracker.
Type-safe validated configuration properties from application.yml. Use when adding any externalisable value.
Consistent error handling with named exceptions and global handler. Use when implementing any method that can fail with a business reason.
Consistent, safe log statements with correct levels and no PII. Use when adding or reviewing log statements.
Team standard for improving existing code without changing behaviour. Use when refactoring code.
| name | testing |
| description | JUnit and WebMvcTest patterns for the Spring MVC demo. Use when writing any new test or adding coverage. |
class ProductServiceTest {
private ProductService service;
@BeforeEach
void setUp() {
service = new ProductService(); // fresh store per test
}
}
@WebMvcTest)@WebMvcTest(ProductController.class)
class ProductControllerTest {
@Autowired MockMvc mockMvc;
@Autowired ObjectMapper objectMapper;
@MockBean ProductService productService;
}
new ProductService() in @BeforeEach.@WebMvcTest only — no @SpringBootTest.@MockBean, never instantiate it in controller tests.$.code in error responses — never $.message.willThrow(new XxxException(id)).given(service).method(id) for void methods.method_condition_expectedResult
@SpringBootTest — @WebMvcTest for controllers, plain JUnit for services$.message text — assert on $.code onlynew ProductService() in @BeforeEach