springboot-tdd
Skill27 starsChanged 9 months agoMITView on GitHub
Test-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.
19 other projects use a version of this, 13 of them edited.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codeedited, first seen Nov 8, 2026
- ControllableModel/SWE-Skills-Benchword for word, first seen Nov 8, 2026
- TsinHzl/claude-code-configedited, first seen Nov 1, 2026
- renepf/claude-skillsedited, first seen Oct 25, 2026
- davidanthonyn/claude-skillsedited, first seen Oct 20, 2026
- gongyijie85/dsh-eccedited, first seen Oct 13, 2026
Used with
Projects with it also use configure-ecc, django-verification and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
royaluniondesign-sysSkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 6 projects that use this
mstuder-slalomSkilldjango-verification
Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.
Also in 9 projects that use this
HABUBUSSSkillproject-guidelines-example
Also in 8 projects that use this
royaluniondesign-sysSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 6 projects that use this
mstuder-slalomSkilldjango-security
Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations.
Also in 9 projects that use this
junimnjwSkillcarrier-relationship-management
Codified expertise for managing carrier portfolios, negotiating freight rates, tracking carrier performance, allocating freight, and maintaining strategic carrier relationships. Informed by transportation managers with 15+ years experience. Includes scorecarding frameworks, RFP processes, market intelligence, and compliance vetting. Use when managing carriers, negotiating rates, evaluating carrier performance, or building freight strategies.
Also in 4 projects that use this
- +3 more from royaluniondesign-sys
- +1 more from mstuder-slalom
Other versions19 projects use a version of this.
Word for word · 4
- FaisalAlqarni/sp-ecc★ 9100% same
- ControllableModel/SWE-Skills-Bench★ 8100% same
- Lukasbrujula/claude-code-framework★ 4100% same
- gabrielrovesti/ai-agent-skills★ 1100% same
Edited · 13
- loulanyue/awesome-claude-notes★ 27299% same
- Fmarzochi/EGC★ 6199% same
- gongyijie85/dsh-ecc★ 898% same
- TsinHzl/claude-code-config★ 261% same
- junimnjw/everything-claude-code★ 199% same
- Rojios/everything-claude-code★ 199% same
- royaluniondesign-sys/claude-os★ 199% same
- SamuelNDCE/claude-super-skill-library★ 199% same
- TironFox/everything-claude-code★ 199% same
- davidanthonyn/claude-skills★ 099% same
3 more not listed
Wrote their own version · 2
- peopleforrester/claude-dotfiles★ 3same name
- minghaoZhangZ/shipkit★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- examples/CLAUDE.mdCLAUDE.md
- backend-patternsSkill
- eval-harnessSkill
- frontend-patternsSkill
- iterative-retrievalSkill
- java-coding-standardsSkill
- jpa-patternsSkill
- kafka-patternsSkill
- postgres-patternsSkill
- python-patternsSkill
- python-testingSkill
- security-reviewSkill
- springboot-patternsSkill
- springboot-securitySkill
The file
We split this skill into the rules it gives an agent
6 rules. 4 are common, 0 are distinctive, and 2 are very specific to this project.
4
Common
Most of the 13 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 18
Write tests first (they should fail)
- Common: line 46
Avoid partial mocks; prefer explicit stubbing
- Very specific: line 47
Use @ParameterizedTest for variants
- Common: line 112
Use reusable containers for Postgres/Redis to mirror production
- Very specific: line 138
Prefer AssertJ (assertThat) for readability
- Common: line 157
Remember: Keep tests fast, isolated, and deterministic.
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spring Boot TDD Workflow
TDD guidance for Spring Boot services with 80%+ coverage (unit + integration).
When to Use
- New features or endpoints
- Bug fixes or refactors
- Adding data access logic or security rules
Workflow
- Write tests first (they should fail)
- Implement minimal code to pass
- Refactor with tests green
- Enforce coverage (JaCoCo)
Unit Tests (JUnit 5 + Mockito)
@ExtendWith(MockitoExtension.class)
class MarketServiceTest {
@Mock MarketRepository repo;
@InjectMocks MarketService service;
@Test
void createsMarket() {
CreateMarketRequest req = new CreateMarketRequest("name", "desc", Instant.now(), List.of("cat"));
when(repo.save(any())).thenAnswer(inv -> inv.getArgument(0));
Market result = service.create(req);
assertThat(result.name()).isEqualTo("name");
verify(repo).save(any());
}
}Patterns:
- Arrange-Act-Assert
- Avoid partial mocks; prefer explicit stubbing
- Use
@ParameterizedTestfor variants
Web Layer Tests (MockMvc)
@WebMvcTest(MarketController.class)
class MarketControllerTest {
@Autowired MockMvc mockMvc;
@MockBean MarketService marketService;
@Test
void returnsMarkets() throws Exception {
when(marketService.list(any())).thenReturn(Page.empty());
mockMvc.perform(get("/api/markets"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.content").isArray());
}
}Integration Tests (SpringBootTest)
@SpringBootTest
@AutoConfigureMockMvc
@ActiveProfiles("test")
class MarketIntegrationTest {
@Autowired MockMvc mockMvc;
@Test
void createsMarket() throws Exception {
mockMvc.perform(post("/api/markets")
.contentType(MediaType.APPLICATION_JSON)
.content("""
{"name":"Test","description":"Desc","endDate":"2030-01-01T00:00:00Z","categories":["general"]}
"""))
.andExpect(status().isCreated());
}
}Persistence Tests (DataJpaTest)
@DataJpaTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@Import(TestContainersConfig.class)
class MarketRepositoryTest {
@Autowired MarketRepository repo;
@Test
void savesAndFinds() {
MarketEntity entity = new MarketEntity();
entity.setName("Test");
repo.save(entity);
Optional<MarketEntity> found = repo.findByName("Test");
assertThat(found).isPresent();
}
}Testcontainers
- Use reusable containers for Postgres/Redis to mirror production
- Wire via
@DynamicPropertySourceto inject JDBC URLs into Spring context
Coverage (JaCoCo)
Maven snippet:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.14</version>
<executions>
<execution>
<goals><goal>prepare-agent</goal></goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals><goal>report</goal></goals>
</execution>
</executions>
</plugin>Assertions
- Prefer AssertJ (
assertThat) for readability - For JSON responses, use
jsonPath - For exceptions:
assertThatThrownBy(...)
Test Data Builders
class MarketBuilder {
private String name = "Test";
MarketBuilder withName(String name) { this.name = name; return this; }
Market build() { return new Market(null, name, MarketStatus.ACTIVE); }
}CI Commands
- Maven:
mvn -T 4 testormvn verify - Gradle:
./gradlew test jacocoTestReport
Remember: Keep tests fast, isolated, and deterministic. Test behavior, not implementation details.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

