tdd-workflow

Guides test-driven development of Spring Boot features with OpenAPI-first integration tests.

Updated Apr 18, 2026
One-click install
npx skills add https://github.com/heiherilala-vawd/ompany-Management --skill tdd-workflow-heiherilala-vawd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/heiherilala-vawd/ompany-Management/tree/main/.agents/skills/tdd-workflow
Command: npx skills add https://github.com/heiherilala-vawd/ompany-Management --skill tdd-workflow-heiherilala-vawd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It enforces a disciplined Red-Green-Refactor workflow in an OpenAPI-first Spring Boot project, preventing untested code from reaching the DAO, Service, or Controller layers. ## Core Features & Use Cases - Test-first enforcement: Write integration tests before any implementation, verify they fail (RED), then implement until they pass (GREEN). - OpenAPI-first workflow: Update api.yml, regenerate the Java client with publishJavaClientToMavenLocal, then use generated DTOs in tests and code. - Ready-made patterns: Provides templates for integration tests (Testcontainers, JWT tokens, TestUtils fixtures), Mockito service tests, validator tests, JPA entities, mappers, and controllers. - Use Case: When adding a new query filter to an existing GET endpoint, follow the strict order: write the failing IT first, update api.yml, regenerate the client, then implement DAO → Service → Controller. ## Quick Start Ask the assistant to implement a new endpoint or entity in this Spring Boot project following the TDD workflow, starting with a failing integration test.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I apply TDD when adding a new endpoint in Spring Boot?

Write the integration test first and confirm it fails (RED), then update api.yml, regenerate the client with publishJavaClientToMavenLocal, and implement DAO, Service, and Controller until the test passes (GREEN). Finish by refactoring and running the full Gradle build.

How do I add a query filter to an existing GET endpoint with TDD?

Modify or create the integration test for the new filter before touching any code. Add the parameter to api.yml, regenerate the Java client, then implement the filter in the DAO, Service, and Controller in that order until the test passes.

What test structure does a Spring Boot integration test need with Testcontainers?

Use @SpringBootTest with a random port, @Testcontainers, @DirtiesContext for state-mutating tests, and a ContextInitializer extending AbstractContextInitializer. Mock SentryConf, AuthenticationManager, and JwtUtils, and load test data via TestDataSqlLoader in @BeforeEach.

Why must the OpenAPI client be regenerated after changing api.yml?

The generated DTOs in build/gen are the single source of truth for request and response models. Without running publishJavaClientToMavenLocal, tests and controllers reference stale classes and compilation fails or behavior diverges from the spec.

What are common TDD anti-patterns in a Spring Boot project?

Writing implementation before tests, modifying a failing test to make it pass, skipping 400 and 403 cases, and forgetting @DirtiesContext on mutating tests. Each test should verify one behavior and must be observed failing before implementation begins.