# Spring boot testing

> Spring boot testing is an open-source agent skill for developer tools. Guides an agent to pick and write Spring Boot tests: slices, Testcontainers, MockitoBean. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/github/awesome-copilot/tree/main/skills/spring-boot-testing
- **Repository:** https://github.com/github/awesome-copilot
- **GitHub stars:** 41,707
- **License:** MIT
- **Skill name:** spring-boot-testing
- **Collection:** https://github.com/github/awesome-copilot
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-30

## About

This skill helps an agent test Spring Boot applications by first checking the project's Spring Boot version and test dependencies, then choosing the narrowest suitable test slice for the code under test. It covers web-layer tests with MockMvc, data-layer tests against real databases through Testcontainers and @ServiceConnection, REST client tests, JSON mapping tests, and full-context integration tests run through Failsafe.

The guidance includes coding conventions: AssertJ-style assertions, helper methods for shared setup, @DisplayName for readable test intent, and an ordering of main scenario, other paths, then error cases. It also suggests refactoring when a method needs more than a handful of test cases, and sets a Jacoco-based coverage target of around 80 percent with a focus on business-critical paths.

The skill is written for Spring Boot 4 with notes for Boot 3 covering mock bean annotations, JUnit versions and modular starters. It expects a Maven or Java project and Java source code to work from.

## When your agent uses it

> Expert Spring Boot testing specialist that selects the best testing techniques for your situation: test slices, Testcontainers with @ServiceConnection, Failsafe integration tests, MockitoBean, JUnit and AssertJ. Written for Spring Boot 4 with notes for Boot 3.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/github/awesome-copilot/tree/HEAD/skills/spring-boot-testing)
- [License: MIT](https://github.com/github/awesome-copilot/tree/HEAD/skills/spring-boot-testing)

## Features

- **Version-aware setup:** Checks the Spring Boot version and test dependencies before writing tests, with Boot 3 and Boot 4 differences noted.
- **Test slice selection:** Maps scenarios such as controllers, repositories, REST clients and JSON to the matching Spring Boot test slice.
- **Testcontainers integration:** Shows how to run database tests against real containers using @ServiceConnection.
- **Failsafe integration tests:** Explains how to bind Failsafe so *IT classes run under the verify goal.
- **Mocking and assertions:** Covers MockitoBean usage along with AssertJ collection and scalar assertion references.
- **Coverage and test structure:** Sets an 80 percent coverage target with Jacoco and an ordering for main, edge and error tests.

## Good for

- Write a controller test with MockMvc for a REST endpoint
- Add a repository test that runs against a real PostgreSQL container
- Set up Failsafe so integration tests run during mvn verify
- Migrate existing tests from Spring Boot 3 mock annotations to Boot 4
- Test an external API client using a mocked REST server

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/spring-boot-testing` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/spring-boot-testing &&
cp -R "$tmp/skills/spring-boot-testing" ~/.claude/skills/spring-boot-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/spring-boot-testing` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/spring-boot-testing` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/spring-boot-testing &&
cp -R "$tmp/skills/spring-boot-testing" ~/.agents/skills/spring-boot-testing &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/spring-boot-testing` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/spring-boot-testing` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/spring-boot-testing &&
cp -R "$tmp/skills/spring-boot-testing" ~/.cursor/skills/spring-boot-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/spring-boot-testing` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/github/awesome-copilot.git --path skills/spring-boot-testing
```

Or copy the folder to `~/.gemini/skills/spring-boot-testing` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/spring-boot-testing`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/spring-boot-testing &&
cp -R "$tmp/skills/spring-boot-testing" ~/.copilot/skills/spring-boot-testing &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/spring-boot-testing` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/github/awesome-copilot.git
```

Then copy `awesome-copilot/skills/spring-boot-testing` into your agent's skills folder as `spring-boot-testing`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Which Spring Boot versions does Spring boot testing cover?

Examples target Spring Boot 4, and the skill includes compatibility notes for Spring Boot 3.

### Does Spring boot testing run any scripts or tools itself?

No scripts are included; it guides the agent through writing tests and uses Maven commands such as ./mvnw verify.

### Does Spring boot testing upgrade dependencies?

The skill says to read the project's versions and not upgrade them implicitly.

### How do I install Spring boot testing in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/spring-boot-testing to use it in all your projects, or to .claude/skills/spring-boot-testing in one project.

### Does Spring boot testing run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Spring boot testing?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Spring boot testing?

The closest alternatives to Spring boot testing are Java springboot, Java junit, Spring security, Junit 5 skill and Kotlin springboot.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Java springboot](https://ai-powered.com/skills/java-springboot): Java springboot is an open-source agent skill for developer tools.
- [Java junit](https://ai-powered.com/skills/java-junit): Java junit is an open-source agent skill for developer tools.
- [Spring security](https://ai-powered.com/skills/spring-security): Spring security is an open-source agent skill for security.
- [Junit 5 skill](https://ai-powered.com/skills/junit-5-skill): Junit 5 skill is an open-source agent skill for developer tools.
- [Kotlin springboot](https://ai-powered.com/skills/kotlin-springboot): Kotlin springboot is an open-source agent skill for developer tools.
- [Spring observability](https://ai-powered.com/skills/spring-observability): Spring observability is an open-source agent skill for developer tools.
- [Spring boot 4 migration](https://ai-powered.com/skills/spring-boot-4-migration): Spring boot 4 migration is an open-source agent skill for developer tools.
- [Create spring boot java project](https://ai-powered.com/skills/create-spring-boot-java-project): Create spring boot java project is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/spring-boot-testing
