What problem does it solve?
This Skill provides a comprehensive framework and best practices for setting up robust integration tests for Java/Spring Boot services using the Spock Framework, significantly improving test reliability and developer productivity.
Core Features & Use Cases
- Testcontainers Integration: Seamlessly configure and use Docker containers for databases (PostgreSQL) and caches (Valkey/Redis).
- Mocking Strategies: Implement effective mocking for external services using GrpcMock (for gRPC) and WireMock (for REST), with clear guidelines on when to use
@MockitoBean or @SpringBean for ProtoShims.
- gRPC & REST Testing: Detailed patterns for testing gRPC handlers, external gRPC clients, and REST controllers.
- Kafka Consumer Testing: Utilize
@EmbeddedKafka for efficient testing of Kafka message consumers.
- Use Case: When developing a new microservice, use this Skill to quickly establish a solid integration testing foundation, ensuring all external dependencies are correctly mocked and infrastructure is properly configured, leading to faster development cycles and fewer production bugs.
Quick Start
Use the java-setup-integration-tests skill to create a new BaseIntegrationSpec for your Java Spring Boot service.