Claude Marketplaces
SkillsMCP serversMarketplacesDigestTools
Submit

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP servers by category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control
Claude Marketplaces

An independent directory of skills, plugins and MCP servers for Claude Code. Not affiliated with Anthropic.

Browse

  • Skills
  • MCP servers
  • Marketplaces
  • Weekly digest
  • Skill index
  • MCP index
  • Marketplace index

Site

  • About
  • Tools
  • Submit
  • Feedback
  • Privacy
  • llms.txt
  • Plugins reference

Maker

  • Snug
  • Agent Caffeine
  • knobs
  • Wax
  • Vectoys
  • mertduzgun.com
Crafted at
Skills/Testing & QA
github avatar

Spring Boot Testing

github/awesome-copilotOfficial

This is a comprehensive testing guide for Spring Boot 4 applications that cuts through the noise with a clear decision tree: use @WebMvcTest for controllers, @DataJpaTest for repositories, and plain JUnit for business logic. It emphasizes modern tools like MockMvcTester and RestTestClient over legacy alternatives, pairs everything with AssertJ for readable assertions, and includes practical references for each test slice. The best practices section is pragmatic, recommending 80% coverage with Jacoco and suggesting refactoring when a method needs more than 5-7 test cases. It's opinionated about the test pyramid and context caching, which is exactly what you want when learning a testing stack this deep.

installs
2K
GitHub stars
40.5K
last updated
Aug 21, 2026
View on GitHubSave

Install

$ npx -y skills add github/awesome-copilot --skill spring-boot-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

Spring Boot Testing

This skill provides expert guidance for testing Spring Boot applications with modern patterns and best practices. Examples target Spring Boot 4; see the compatibility note below for Boot 3.

Compatibility: detect first

Read the project's Spring Boot version and test dependencies before writing tests, and do not upgrade them implicitly.

Spring Boot 3.xSpring Boot 4.x
JUnit5 (Jupiter)6 by default (same org.junit.jupiter.api annotations; JUnit 5 tests keep working)
Mock beans@MockitoBean / @MockitoSpyBean from 3.4 (Spring Framework 6.2); @MockBean / @SpyBean are deprecated@MockitoBean replaces @MockBean (do not use the old ones)
Test startersspring-boot-starter-test covers everythingmodular: add spring-boot-starter-webmvc-test, spring-boot-starter-data-jpa-test, ...
Slice importsorg.springframework.boot.test.autoconfigure...moved, e.g. org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest
Testcontainers1.x names2.x names (testcontainers-postgresql)

Details: references/sb4-migration.md, references/mockitobean.md.

Core Principles

  1. Test Pyramid: Unit (fast) > Slice (focused) > Integration (complete)
  2. Right Tool: Use the narrowest slice that gives you confidence
  3. AssertJ Style: Fluent, readable assertions over verbose matchers
  4. Modern APIs: Prefer MockMvcTester and RestTestClient over legacy alternatives

Which Test Slice?

ScenarioAnnotationReference
Controller + HTTP semantics@WebMvcTestreferences/webmvctest.md
Repository + JPA queries@DataJpaTestreferences/datajpatest.md
REST client + external APIs@RestClientTestreferences/restclienttest.md
JSON (de)serialization@JsonTestreferences/test-slices-overview.md
Full application@SpringBootTestreferences/test-slices-overview.md

Test Slices Reference

  • references/test-slices-overview.md - Decision matrix and comparison
  • references/webmvctest.md - Web layer with MockMvc
  • references/datajpatest.md - Data layer with Testcontainers
  • references/restclienttest.md - REST client testing

Testing Tools Reference

  • references/mockmvc-tester.md - AssertJ-style MockMvc (3.2+)
  • references/mockmvc-classic.md - Traditional MockMvc (pre-3.2)
  • references/resttestclient.md - Spring Boot 4+ REST client
  • references/mockitobean.md - Mocking dependencies

Assertion Libraries

  • references/assertj-basics.md - Scalars, strings, booleans, dates
  • references/assertj-collections.md - Lists, Sets, Maps, arrays

Testcontainers and integration tests

  • references/testcontainers-jdbc.md - @ServiceConnection quickstart, PostgreSQL, MySQL, etc.
  • references/failsafe-integration-tests.md - *IT classes silently skipped unless Failsafe is bound; run ./mvnw verify

Maven gotcha: Failsafe declared only in <pluginManagement> means *IT tests never run. Declare it in <build><plugins> with the integration-test and verify goals and run ./mvnw verify.

Test Data Generation

  • references/instancio.md - Generate complex test objects (3+ properties)

Performance & Migration

  • references/context-caching.md - Speed up test suites
  • references/sb4-migration.md - Spring Boot 4.0 changes

Quick Decision Tree

Testing a controller endpoint?
  Yes → @WebMvcTest with MockMvcTester

Testing repository queries?
  Yes → @DataJpaTest with Testcontainers (real DB)

Testing business logic in service?
  Yes → Plain JUnit + Mockito (no Spring context)

Testing external API client?
  Yes → @RestClientTest with MockRestServiceServer

Testing JSON mapping?
  Yes → @JsonTest

Need full integration test?
  Yes → @SpringBootTest with minimal context config

Spring Boot 4 Highlights

  • RestTestClient: Modern alternative to TestRestTemplate
  • @MockitoBean: Replaces @MockBean (deprecated)
  • MockMvcTester: AssertJ-style assertions for web tests
  • Modular starters: Technology-specific test starters
  • Context pausing: Automatic pausing of cached contexts (Spring Framework 7)

Testing Best Practices

Code Complexity Assessment

When a method or class is too complex to test effectively:

  1. Analyze complexity - If you need more than 5-7 test cases to cover a single method, it's likely too complex
  2. Recommend refactoring - Suggest breaking the code into smaller, focused functions
  3. User decision - If the user agrees to refactor, help identify extraction points
  4. Proceed if needed - If the user decides to continue with the complex code, implement tests despite the difficulty

Example of refactoring recommendation:

// Before: Complex method hard to test
public Order processOrder(OrderRequest request) {
  // Validation, discount calculation, payment, inventory, notification...
  // 50+ lines of mixed concerns
}

// After: Refactored into testable units
public Order processOrder(OrderRequest request) {
  validateOrder(request);
  var order = createOrder(request);
  applyDiscount(order);
  processPayment(order);
  updateInventory(order);
  sendNotification(order);
  return order;
}

Avoid Code Redundancy

Create helper methods for commonly used objects and mock setup to enhance readability and maintainability.

Test Organization with @DisplayName

Use descriptive display names to clarify test intent:

@Test
@DisplayName("Should calculate discount for VIP customer")
void shouldCalculateDiscountForVip() { }

@Test
@DisplayName("Should reject order when customer has insufficient credit")
void shouldRejectOrderForInsufficientCredit() { }

Test Coverage Order

Always structure tests in this order:

  1. Main scenario - The happy path, most common use case
  2. Other paths - Alternative valid scenarios, edge cases
  3. Exceptions/Errors - Invalid inputs, error conditions, failure modes

Test Production Scenarios

Write tests with real production scenarios in mind. This makes tests more relatable and helps understand code behavior in actual production cases.

Test Coverage Goals

Aim for 80% code coverage as a practical balance between quality and effort. Higher coverage is beneficial but not the only goal.

Use Jacoco maven plugin for coverage reporting and tracking.

Coverage Rules:

  • 80+% coverage minimum
  • Focus on meaningful assertions, not just execution

What to Prioritize:

  1. Business-critical paths (payment processing, order validation)
  2. Complex algorithms (pricing, discount calculations)
  3. Error handling (exceptions, edge cases)
  4. Integration points (external APIs, databases)

Dependencies (Spring Boot 4)

See also: https://docs.spring.io/spring-boot/reference/testing/spring-boot-applications.html and https://docs.spring.io/spring-boot/reference/features/dev-services.html.

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-test</artifactId>
  <scope>test</scope>
</dependency>

<!-- For WebMvc tests -->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-webmvc-test</artifactId>
  <scope>test</scope>
</dependency>

<!-- For Testcontainers -->
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-testcontainers</artifactId>
  <scope>test</scope>
</dependency>
SKILL.md on GitHub

Sponsors

SnugThe clipboard manager you and your agent can use, safelyAgent CaffeineClose your lid, come back to finished workWaxBlock anything with supervision, without erasing your iPhoneOpen StepsSponsoredFree and open-source skills that make AI coding agents easier to understand, verify, and control.

Details

Repository
github.com/github/awesome-copilot
Categories
Testing & QA, Git & Pull Requests, AI & Agent Building, Java & JVM
First seen
Apr 16, 2026

More from github/awesome-copilot

All 318
  • Codeql2K
  • Microsoft Agent Framework1.9K
  • Flowstudio Power Automate Build1.9K
  • Flowstudio Power Automate Debug1.9K
  • Issue Fields Migration1.9K
  • Gtm Positioning Strategy1.9K
  • Publish To Pages1.8K
  • Reviewing Oracle To Postgres Migration1.8K
  • Migrating Oracle To Postgres Stored Procedures1.8K
  • Creating Oracle To Postgres Migration Integration Tests1.8K
  • Gtm Product Led Growth1.8K
  • Unit Test Vue Pinia1.8K
  • Creating Oracle To Postgres Master Migration Plan1.8K
  • Creating Oracle To Postgres Migration Bug Report1.8K
  • Planning Oracle To Postgres Migration Integration Testing1.8K
  • Oo Component Documentation1.8K
  • Scaffolding Oracle To Postgres Migration Test Project1.7K
  • Gtm 0 To 1 Launch1.7K
  • Sandbox Npm Install1.7K
  • Semantic Kernel1.7K
  • Gtm Technical Product Pricing1.7K
  • Gdpr Compliant1.7K
  • Aws Cdk Python Setup1.6K
  • Gtm Ai Gtm1.6K

Recommended

More Testing & QA
1anthropics avatarinitiating-coverageanthropics/financial-servicesCreate institutional-quality equity research initiation reports through a 5-task workflow. Tasks must be executed individually with verified prerequisites - (1)2Kinstalls
2anthropics avatarcash-flow-snapshotanthropics/knowledge-work-pluginsReads AR/AP, historical cash timing, and known fixed costs from QuickBooks, PayPal, Stripe, or Square — or a CSV upload — and produces a 30/60/90-day cash flow 1.9Kinstalls
3affaan-m avatarwindows-desktop-e2eaffaan-m/everything-claude-codewindows desktop e2e1.8Kinstalls
4refoundai avatarusability-testingrefoundai/lenny-skillsHelp users conduct effective usability testing. Use when someone is planning user tests, designing prototype validation, preparing usability studies, or trying 1.8Kinstalls
5github avatarscaffolding-oracle-to-postgres-migration-test-projectgithub/awesome-copilotScaffolds an xUnit integration test project for validating Oracle-to-PostgreSQL database migration behavior in .NET solutions. Creates the test project, transac1.7Kinstalls
6affaan-m avatarfsharp-testingaffaan-m/everything-claude-codefsharp testing1.6Kinstalls