testing-junit

Provides JUnit 5 testing guidance for Java/Spring layered projects with Given-When-Then patterns.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/rivkode/reservation --skill testing-junit-rivkode
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: testing-junit
Source: https://github.com/rivkode/reservation/tree/main/.claude/skills/testing-junit
Command: npx skills add https://github.com/rivkode/reservation --skill testing-junit-rivkode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Java/Spring ํ”„๋กœ์ ํŠธ์—์„œ JUnit 5 ๊ธฐ๋ฐ˜ ํ…Œ์ŠคํŠธ๋ฅผ ๊ณ„์ธต๋ณ„๋กœ ์„ค๊ณ„ํ•˜๊ณ  ๊ตฌํ˜„ํ•˜๋Š” ๋ฐ ํ•„์š”ํ•œ ์›์น™๊ณผ ์‹ค์ฒœ ๋ฐฉ๋ฒ•์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. Domain, Application, Infrastructure, Presentation ๋ ˆ์ด์–ด ๊ฐ„ ๋…๋ฆฝ์„ฑ๊ณผ ๋น ๋ฅธ ํ”ผ๋“œ๋ฐฑ์„ ๋ณด์žฅํ•˜๋Š” ํ…Œ์ŠคํŠธ ์ „๋žต์„ ์ œ์‹œํ•ฉ๋‹ˆ๋‹ค.

Core Features & Use Cases

  • ๊ณ„์ธต๋ณ„ ๋…๋ฆฝ ํ…Œ์ŠคํŠธ ์›์น™: ๋„๋ฉ”์ธ ๋ชจ๋ธ์˜ ์ˆœ์ˆ˜ ํ…Œ์ŠคํŠธ์™€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„œ๋น„์Šค์˜ ๋ชจ์˜ ๊ฒฝ๊ณ„ ๋ถ„๋ฆฌ.
  • Given-When-Then ๊ตฌ์กฐ์™€ ์Šฌ๋ผ์ด์Šค ํ…Œ์ŠคํŠธ: Spring Test ์Šฌ๋ผ์ด์Šค๋ฅผ ํ™œ์šฉํ•œ ๋น ๋ฅด๊ณ  ์•ˆ์ •์ ์ธ ํ…Œ์ŠคํŠธ ๊ตฌ์„ฑ.
  • Mockito ๋ฐ JUnit 5๋ฅผ ํ†ตํ•œ ์ผ๊ด€๋œ ํ…Œ์ŠคํŠธ ์Šคํƒ€์ผ๊ณผ ๊ฒ€์ฆ ์ปค๋ฒ„๋ฆฌ์ง€ ๊ฐ•ํ™”.

Quick Start

JUnit 5, Mockito, Spring Test ์Šฌ๋ผ์ด์Šค๋ฅผ ์„ค์ •ํ•˜๊ณ  ๋„๋ฉ”์ธ/์• ํ”Œ๋ฆฌ์ผ€์ด์…˜/์ธํ”„๋ผ ๊ณ„์ธต ํ…Œ์ŠคํŠธ๋ฅผ ์‹œ์ž‘ํ•œ๋‹ค.

Frequently Asked Questions about testing-junit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure JUnit 5 tests for a Spring application across different layers?โ–ผ

Structure JUnit 5 tests by applying Given-When-Then patterns and mock boundaries across Domain, Application, Infrastructure, and Presentation layers. This layered approach ensures test independence, fast feedback, and clear verification using Spring Test slices and Mockito.

What is the best way to isolate domain logic from infrastructure in Spring tests?โ–ผ

The best way to isolate domain logic is by defining strict mock boundaries between your Application and Infrastructure layers. Use pure JUnit 5 tests for domain models and Mockito to mock external dependencies, ensuring deterministic and fast verification.

How does slice testing work with JUnit 5 and Spring Test?โ–ผ

Slice testing works by loading only the specific application context components required for a single layer, such as Web or Data slices. Using JUnit 5 and Spring Test slices provides fast, reliable, and isolated verification without starting the entire Spring application context.

Can I use Mockito to enforce consistent test naming and fixture practices in Java?โ–ผ

Yes, you can use Mockito alongside JUnit 5 to enforce consistent test naming, clean fixture practices, and structured verification. This combination standardizes test architecture, strengthens verification coverage, and outlines required annotations for reliable Java testing.

When should I use Given-When-Then patterns in Spring application service tests?โ–ผ

Use Given-When-Then patterns in Spring application service tests to clearly separate mock setup, method execution, and verification. This structured approach enforces reliable, deterministic tests while maintaining clear boundaries between Domain, Application, and Presentation layers.

Why are my Spring integration tests slow and non-deterministic?โ–ผ

Spring integration tests are often slow because they load the entire application context instead of using targeted Spring Test slices. By applying slice testing and mock boundaries with JUnit 5 and Mockito, you achieve fast, isolated, and deterministic test execution.