
Java Testing
Handles the full spectrum of Java testing from JUnit 5 unit tests to Testcontainers integration tests. You get Mockito mocking patterns, AssertJ assertions, Spring Boot test slices, and MockMvc for API testing. The examples are solid and cover the BDD style (given/when/then) which keeps tests readable. Includes parameterized tests, test builders for cleaner setup, and JaCoCo coverage configs targeting 80%. The troubleshooting guide actually addresses real problems like flaky tests from shared state and mock initialization failures. Works with both JUnit 5 and TestNG, though the examples lean heavily on JUnit. Good for greenfield test suites or modernizing older JUnit 4 codebases.
- skills.sh installs
- 909
- GitHub stars
- 42
- last updated
- Aug 21, 2026
Install
$ npx -y skills add pluginagentmarketplace/custom-plugin-java --skill java-testing --agent claude-codeInstalls into .claude/skills of the current project.
Files
Java Testing Skill
Write comprehensive tests for Java applications with modern testing practices.
Overview
This skill covers Java testing with JUnit 5, Mockito, AssertJ, and integration testing with Spring Boot Test and Testcontainers. Includes TDD patterns and test coverage strategies.
When to Use This Skill
Use when you need to:
- Write unit tests with JUnit 5
- Create mocks with Mockito
- Build integration tests with Testcontainers
- Implement TDD/BDD practices
- Improve test coverage
Topics Covered
JUnit 5
- @Test, @Nested, @DisplayName
- @ParameterizedTest with sources
- Lifecycle annotations
- Extensions and custom annotations
Mockito
- @Mock, @InjectMocks, @Spy
- Stubbing (when/thenReturn)
- Verification (verify, times)
- BDD style (given/willReturn)
AssertJ
- Fluent assertions
- Collection assertions
- Exception assertions
- Custom assertions
Integration Testing
- @SpringBootTest slices
- Testcontainers setup
- MockMvc for APIs
- Database testing
Quick Reference
// Unit Test with Mockito
@ExtendWith(MockitoExtension.class)
class UserServiceTest {
@Mock
private UserRepository userRepository;
Sponsors
Details
- Repository
- github.com/pluginagentmarketplace/custom-plugin-java
- Categories
- Testing & QA, Java & JVM
- First seen
- Apr 16, 2026