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-code

Installs 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

More from pluginagentmarketplace/custom-plugin-java

All 12
1mindrally avatarjestmindrally/skillsJest testing best practices for JavaScript and TypeScript applications, covering test structure, mocking, and assertion patterns.896skills.sh installs
2encoredev avatarencore-testingencoredev/skillsWrite or run automated tests for Encore.ts code with `encore test` and vitest/jest. Covers isolated per-test databases, calling handlers directly, and `describe829skills.sh installs
3testdino-hq avatarplaywright-clitestdino-hq/playwright-skillAutomates browser interactions for testing and validating your own web applications using playwright-cli. Use when you need terminal-first browser control for n815skills.sh installs
4hairyf avatarvitesthairyf/skillsVitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filteri789skills.sh installs
5adobe avatarappbuilder-testingadobe/skillsGenerate and run tests for Adobe App Builder actions and UI components. Scaffolds Jest unit tests, integration tests against deployed actions, contract tests fo766skills.sh installs
6posit-dev avatartesting-r-packagesposit-dev/skillsBest practices for writing R package tests using testthat version 3+. Use when writing, organizing, or improving tests for R packages. Covers test structure, ex749skills.sh installs