Comprehensive developer toolkit providing reusable skills for Java/Spring Boot, TypeScript/NestJS/React/Next.js, Python, PHP, AWS CloudFormation, AI/RAG, DevOps, and more.
90
90%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
Generates comprehensive integration tests for Spring Boot classes using Testcontainers (PostgreSQL, Redis, MongoDB) with
@ServiceConnection pattern. Use when writing integration tests for service or repository classes.
You are tasked with generating a complete integration test for the Java class specified in $1.
When analyzing the target class, Claude will automatically reference these skills to:
@MockitoBean for mocking dependencies (replaces deprecated @MockBean)| Argument | Description |
|---|---|
$ARGUMENTS | Combined arguments passed to the command |
Agent Selection: To execute this task, use the following agent with fallback:
developer-kit-java:spring-boot-unit-testing-expertdeveloper-kit-java:spring-boot-unit-testing-expert or fallback to general-purpose agent with
spring-boot-test-patterns skill$1Based on dependencies, include:
Follow these patterns from the spring-boot-test-patterns skill:
@SpringBootTest
@Testcontainers class
<ClassName> IntegrationTest {
@Container
@ServiceConnection
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>(
DockerImageName.parse("postgres:16-alpine"))
.withDatabaseName("testdb")
.withUsername("test")
.withPassword("test");
@Container
@ServiceConnection
static GenericContainer<?> redis = new GenericContainer<>(
DockerImageName.parse("redis:7-alpine"))
.withExposedPorts(6379);
@Autowired
private <TargetClass > targetClass;
@Test
void shouldPerformIntegrationScenario () {
// Test implementation
}
}@ServiceConnection for Spring Boot 3.5+ automatic wiring@MockitoBean (not deprecated @MockBean) from org.springframework.test.context.bean.override.mockito@Repository/@DataJpaTest: PostgreSQL/MySQL container@Service with caching: Redis container@RestController: MockMvc + required backend containersVerify and add required dependencies:
Maven:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.19.0</version>
// Use latest stable version
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.19.0</version>
// Use latest stable version
<scope>test</scope>
</dependency>Gradle:
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.testcontainers:junit-jupiter:1.19.0")
testImplementation("org.testcontainers:postgresql:1.19.0")Generate tests covering:
@DirtiesContext unless absolutely necessary@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Testcontainers
class UserControllerIntegrationTest {
@Container
@ServiceConnection
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>(
DockerImageName.parse("postgres:16-alpine"));
@Autowired
private TestRestTemplate restTemplate;
@Test
void shouldCreateAndRetrieveUser() {
UserRequest request = new UserRequest("john@example.com", "John Doe");
ResponseEntity<UserResponse> createResponse = restTemplate
.postForEntity("/api/users", request, UserResponse.class);
assertThat(createResponse.getStatusCode()).isEqualTo(HttpStatus.CREATED);
assertThat(createResponse.getBody()).isNotNull();
Long userId = createResponse.getBody().id();
ResponseEntity<UserResponse> getResponse = restTemplate
.getForEntity("/api/users/" + userId, UserResponse.class);
assertThat(getResponse.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(getResponse.getBody().email()).isEqualTo("john@example.com");
}
}import org.springframework.test.context.bean.override.mockito.MockitoBean;
@WebMvcTest(UserController.class)
@Testcontainers
class UserControllerMockTest {
@Autowired
private MockMvc mockMvc;
@MockitoBean // Use @MockitoBean instead of deprecated @MockBean
private UserService userService;
@Test
void shouldReturnUserWhenExists() throws Exception {
User user = new User(1L, "john@example.com", "John Doe");
when(userService.findById(1L)).thenReturn(Optional.of(user));
mockMvc.perform(get("/api/users/1"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.email").value("john@example.com"));
}
}@SpringBootTest
@Testcontainers
class UserServiceIntegrationTest {
@Container
@ServiceConnection
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>(
DockerImageName.parse("postgres:16-alpine"));
@Container
@ServiceConnection
static GenericContainer<?> redis = new GenericContainer<>(
DockerImageName.parse("redis:7-alpine"))
.withExposedPorts(6379);
@Autowired
private UserService userService;
@Autowired
private CacheManager cacheManager;
@Test
void shouldCacheUserAfterFirstRetrieval() {
User user = userService.createUser("test@example.com", "Test User");
// First call - hits database
User firstCall = userService.findById(user.getId());
assertThat(firstCall).isNotNull();
// Verify cached
Cache userCache = cacheManager.getCache("users");
assertThat(userCache.get(user.getId())).isNotNull();
// Second call - hits cache
User secondCall = userService.findById(user.getId());
assertThat(secondCall).isEqualTo(firstCall);
}
}@DataJpaTest
@Testcontainers
class UserRepositoryIntegrationTest {
@Container
@ServiceConnection
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>(
DockerImageName.parse("postgres:16-alpine"));
@Autowired
private UserRepository userRepository;
@Test
void shouldFindUsersByEmailDomain() {
userRepository.save(new User("john@example.com", "John"));
userRepository.save(new User("jane@example.com", "Jane"));
userRepository.save(new User("bob@another.com", "Bob"));
List<User> exampleUsers = userRepository.findByEmailEndingWith("@example.com");
assertThat(exampleUsers).hasSize(2);
assertThat(exampleUsers)
.extracting(User::getEmail)
.containsExactlyInAnyOrder("john@example.com", "jane@example.com");
}
}src/test/java matching package structure<ClassName>IntegrationTest.javaAfter generating the test:
@ServiceConnection is used (Spring Boot 3.5+)./mvnw test -Dtest=<ClassName>IntegrationTest@ServiceConnection over @DynamicPropertySource@MockitoBean instead of deprecated @MockBean (from org.springframework.test.context.bean.override.mockito)@Transactional on test methods for automatic rollback@DirtiesContext unless absolutely necessaryThis command leverages the following skills available in the repository:
@ControllerAdvice exception handlers@Scheduled and @Async methods@MockitoBean vs @MockBean: Spring Framework 6.2+ introduces @MockitoBean from
org.springframework.test.context.bean.override.mockito package. The old @MockBean from
org.springframework.boot.test.mock.mockito is deprecated.import org.springframework.test.context.bean.override.mockito.MockitoBean;Target class: $ARGUMENTS
Analyze the class and generate a comprehensive integration test following the patterns above.
/devkit.java.write-integration-tests example-inputdocs
plugins
developer-kit-ai
developer-kit-aws
agents
docs
skills
aws
aws-cli-beast
aws-cost-optimization
aws-drawio-architecture-diagrams
aws-sam-bootstrap
aws-cloudformation
aws-cloudformation-auto-scaling
aws-cloudformation-bedrock
aws-cloudformation-cloudfront
aws-cloudformation-cloudwatch
aws-cloudformation-dynamodb
aws-cloudformation-ec2
aws-cloudformation-ecs
aws-cloudformation-elasticache
references
aws-cloudformation-iam
references
aws-cloudformation-lambda
aws-cloudformation-rds
aws-cloudformation-s3
aws-cloudformation-security
aws-cloudformation-task-ecs-deploy-gh
aws-cloudformation-vpc
references
developer-kit-core
agents
commands
skills
developer-kit-devops
developer-kit-java
agents
commands
docs
skills
aws-lambda-java-integration
aws-rds-spring-boot-integration
aws-sdk-java-v2-bedrock
aws-sdk-java-v2-core
aws-sdk-java-v2-dynamodb
aws-sdk-java-v2-kms
aws-sdk-java-v2-lambda
aws-sdk-java-v2-messaging
aws-sdk-java-v2-rds
aws-sdk-java-v2-s3
aws-sdk-java-v2-secrets-manager
clean-architecture
graalvm-native-image
langchain4j-ai-services-patterns
references
langchain4j-mcp-server-patterns
references
langchain4j-rag-implementation-patterns
references
langchain4j-spring-boot-integration
langchain4j-testing-strategies
langchain4j-tool-function-calling-patterns
langchain4j-vector-stores-configuration
references
qdrant
references
spring-ai-mcp-server-patterns
spring-boot-actuator
spring-boot-cache
spring-boot-crud-patterns
spring-boot-dependency-injection
spring-boot-event-driven-patterns
spring-boot-openapi-documentation
spring-boot-project-creator
spring-boot-resilience4j
spring-boot-rest-api-standards
spring-boot-saga-pattern
spring-boot-security-jwt
assets
references
scripts
spring-boot-test-patterns
spring-data-jpa
references
spring-data-neo4j
references
unit-test-application-events
unit-test-bean-validation
unit-test-boundary-conditions
unit-test-caching
unit-test-config-properties
references
unit-test-controller-layer
unit-test-exception-handler
references
unit-test-json-serialization
unit-test-mapper-converter
references
unit-test-parameterized
unit-test-scheduled-async
references
unit-test-service-layer
references
unit-test-utility-methods
unit-test-wiremock-rest-api
references
developer-kit-php
developer-kit-project-management
developer-kit-python
developer-kit-specs
commands
docs
hooks
test-templates
tests
skills
developer-kit-tools
developer-kit-typescript
agents
docs
hooks
rules
skills
aws-cdk
aws-lambda-typescript-integration
better-auth
clean-architecture
drizzle-orm-patterns
dynamodb-toolbox-patterns
references
nestjs
nestjs-best-practices
nestjs-code-review
nestjs-drizzle-crud-generator
nextjs-app-router
nextjs-authentication
nextjs-code-review
nextjs-data-fetching
nextjs-deployment
nextjs-performance
nx-monorepo
react-code-review
react-patterns
shadcn-ui
tailwind-css-patterns
tailwind-design-system
references
turborepo-monorepo
typescript-docs
typescript-security-review
zod-validation-utilities
references
github-spec-kit