Agent skill

Testing Pyramid

by rrezartprebreza in rrezartprebreza/spring-boot-skills

A skill your agent uses when writing tests of any kind — unit, slice, or integration.

MITAuto-check passedTesting & QA

Install Testing Pyramid

skills CLI
$ npx skills add rrezartprebreza/spring-boot-skills --skill testing-pyramid -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rrezartprebreza/spring-boot-skills testing-pyramid --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rrezartprebreza/spring-boot-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/spring-boot-3/testing-pyramid .claude/skills/testing-pyramid && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
testing-pyramid
GitHub stars
301
Token cost
~1.6k tokens
SKILL.md length
92 words
Files
4
Skills in repo
51
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing tests of any kind — unit, slice, or integration.

  • Writing tests of any kind — unit
  • SKILL.md covers Structure, Unit Tests — Services, Slice Tests — Controllers… and Slice Tests — Repositories…, plus 4 more sections
  • Runs Java scripts from its folder
  • Tasks that involve Integration testing

What it does

Testing Pyramid is an agent skill from rrezartprebreza/spring-boot-skills. Use when writing tests of any kind — unit, slice, or integration. Covers test structure, naming conventions, Mockito patterns, @WebMvcTest, @DataJpaTest, and Testcontainers setup.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files (for example `agents/openai.yaml`).

It sits in Testing & QA, covering Integration testing and Backend development. It works with Spring Boot. The repository describes itself as: Production-grade Claude Code and Codex skills for Spring Boot developers. The licence is MIT.

When your agent uses it

  • Writing tests of any kind — unit
  • Tasks that involve Integration testing
  • Tasks that involve Backend development

Example prompts

  • “/testing-pyramid”

What it can do on your machine

Read from SKILL.md and the folder at commit f0c06a0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Java), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing Pyramid loads about 1.6k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 92 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rrezartprebreza/spring-boot-skills at commit f0c06a0, republished under its MIT licence (© rrezartprebreza). 92 words, ~1,640 tokens.

Download SKILL.mdSave it as .claude/skills/testing-pyramid/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
testing-pyramid
description
Use when writing tests of any kind — unit, slice, or integration. Covers test structure, naming conventions, Mockito patterns, @WebMvcTest, @DataJpaTest, and Testcontainers setup.

Testing Pyramid

Structure

Unit Tests         — fast, no Spring context, mock dependencies    (70%)
Slice Tests        — partial Spring context (@WebMvcTest, @DataJpaTest) (20%)
Integration Tests  — full context + real DB via Testcontainers     (10%)

Unit Tests — Services

java
@ExtendWith(MockitoExtension.class)
class OrderServiceTest {

    @Mock private OrderRepository orderRepository;
    @Mock private InventoryService inventoryService;

    @InjectMocks private OrderService orderService;

    @Test
    void createOrder_whenItemsAvailable_shouldSaveAndReturnOrder() {
        // Given
        var request = new CreateOrderRequest("user@example.com", List.of(new OrderItemRequest(UUID.randomUUID(), 2)));
        var savedOrder = Order.create("user@example.com");
        when(orderRepository.save(any(Order.class))).thenReturn(savedOrder);
        doNothing().when(inventoryService).reserve(any());

        // When
        Order result = orderService.createOrder(request);

        // Then
        assertThat(result).isNotNull();
        assertThat(result.getCustomerEmail()).isEqualTo("user@example.com");
        verify(inventoryService).reserve(request.items());
        verify(orderRepository).save(any(Order.class));
    }

    @Test
    void createOrder_whenInventoryUnavailable_shouldThrowException() {
        // Given
        var request = new CreateOrderRequest("user@example.com", List.of());
        doThrow(new InsufficientInventoryException("Out of stock"))
            .when(inventoryService).reserve(any());

        // When / Then
        assertThatThrownBy(() -> orderService.createOrder(request))
            .isInstanceOf(InsufficientInventoryException.class)
            .hasMessage("Out of stock");
    }
}

Slice Tests — Controllers (@WebMvcTest)

java
@WebMvcTest(OrderController.class)
class OrderControllerTest {

    @Autowired MockMvc mockMvc;
    @Autowired ObjectMapper objectMapper;
    @MockitoBean OrderService orderService; // Spring Boot 3.4+: @MockBean is deprecated

    @Test
    @WithMockUser(roles = "USER")
    void createOrder_withValidRequest_shouldReturn201() throws Exception {
        // Given
        var request = new CreateOrderRequest("user@example.com", List.of());
        var order = Order.create("user@example.com");
        when(orderService.createOrder(any())).thenReturn(order);

        // When / Then
        mockMvc.perform(post("/api/v1/orders")
                .contentType(MediaType.APPLICATION_JSON)
                .content(objectMapper.writeValueAsString(request)))
            .andExpect(status().isCreated())
            .andExpect(jsonPath("$.success").value(true))
            .andExpect(jsonPath("$.data.customerEmail").value("user@example.com"));
    }

    @Test
    @WithMockUser
    void createOrder_withInvalidRequest_shouldReturn400() throws Exception {
        mockMvc.perform(post("/api/v1/orders")
                .contentType(MediaType.APPLICATION_JSON)
                .content("{}")) // missing required fields
            .andExpect(status().isBadRequest())
            .andExpect(jsonPath("$.success").value(false))
            .andExpect(jsonPath("$.error.code").value("VALIDATION_FAILED"));
    }
}

Slice Tests — Repositories (@DataJpaTest)

java
@DataJpaTest
@AutoConfigureTestDatabase(replace = Replace.NONE) // use real DB (Testcontainers)
@Import(TestcontainersConfig.class)
class OrderRepositoryTest {

    @Autowired OrderRepository orderRepository;

    @Test
    void findByStatus_shouldReturnMatchingOrders() {
        // Given
        var order1 = orderRepository.save(Order.create("a@example.com"));
        var order2 = orderRepository.save(Order.create("b@example.com"));
        order2.ship(); // change status
        orderRepository.save(order2);

        // When
        List<Order> pending = orderRepository.findByStatus(OrderStatus.PENDING, Pageable.unpaged()).getContent();

        // Then
        assertThat(pending).hasSize(1);
        assertThat(pending.get(0).getCustomerEmail()).isEqualTo("a@example.com");
    }
}

Integration Tests — Testcontainers

java
// Shared config — reuse container across tests
@TestConfiguration(proxyBeanMethods = false)
public class TestcontainersConfig {

    @Bean
    @ServiceConnection
    PostgreSQLContainer<?> postgresContainer() {
        return new PostgreSQLContainer<>("postgres:16-alpine");
    }
}

// Full integration test
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Import(TestcontainersConfig.class)
class OrderIntegrationTest {

    @Autowired TestRestTemplate restTemplate;
    @Autowired OrderRepository orderRepository;

    @Test
    void createAndRetrieveOrder_endToEnd() {
        // Create
        var createRequest = new CreateOrderRequest("user@example.com", List.of());
        var createResponse = restTemplate.postForEntity("/api/v1/orders", createRequest, ApiResponse.class);
        assertThat(createResponse.getStatusCode()).isEqualTo(HttpStatus.CREATED);

        // Retrieve
        // ... assert persisted correctly
    }
}

Naming Convention

// Method name: methodName_condition_expectedBehavior
createOrder_whenItemsAvailable_shouldSaveOrder()
findById_whenOrderNotFound_shouldThrowNotFoundException()
login_withInvalidCredentials_shouldReturn401()

Testcontainers Dependencies

xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-testcontainers</artifactId>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>postgresql</artifactId>
    <scope>test</scope>
</dependency>

Gotchas

  • Agent uses @SpringBootTest for everything — use slices for speed
  • Agent uses H2 in-memory DB for @DataJpaTest — use Testcontainers for accuracy
  • Agent uses @MockBean — deprecated since Spring Boot 3.4; use @MockitoBean (and @MockitoSpyBean for spies)
  • Agent uses Mockito.mock() instead of @Mock — use annotations with @ExtendWith(MockitoExtension.class)
  • Agent forgets @WithMockUser on controller tests — security filter blocks all requests
  • Agent uses assertEquals from JUnit — use AssertJ (assertThat(...).isEqualTo(...))
  • Agent names tests test_createOrder() — use createOrder_condition_expected() pattern

© rrezartprebreza, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files in skills/spring-boot-3/testing-pyramid of rrezartprebreza/spring-boot-skills.

  • SKILL.md
  • agents/openai.yaml
  • examples/bad-controller-test.java
  • examples/good-controller-test.java

Open the folder on GitHubat commit f0c06a0

Compare with similar skills

Testing Pyramid next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Testing Pyramid compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing Pyramid this skillrrezartprebreza/spring-boot-skills301—~1.6kAutomated safety check: PassMIT
Springboot Verificationaffaan-m/ECC276k5 repos~1.5kAutomated safety check: PassMIT
Springboot TDDaffaan-m/ECC276k3 repos~813Automated safety check: PassMIT
Springboot TDDaffaan-m/ECC276k—~996Automated safety check: PassMIT
322 Frameworks Spring Boot Testing Integration Testsjabrena/plinth447—~935Automated safety check: PassApache-2.0
702 Technologies Wiremockjabrena/plinth447—~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • Run the full Spring Boot verification loop — Maven or Gradle build, SpotBugs, PMD, and Checkstyle static analysis, unit and Testcontainers integration tests with JaCoCo coverage, OWASP dependency…

    276k GitHub starsUsed in 5 repos~1.5k tokens
    Testing & QAAuto-check passed
  • Springboot TDD

    affaan-m/ECC

    使用JUnit 5、Mockito、MockMvc、Testcontainers和JaCoCo进行Spring Boot的测试驱动开发。适用于添加功能、修复错误或重构时。

    276k GitHub starsUsed in 3 repos~813 tokens
    Testing & QAAuto-check passed
  • Springboot TDD

    affaan-m/ECC

    Desarrollo guiado por pruebas para Spring Boot usando JUnit 5, Mockito, MockMvc, Testcontainers y JaCoCo.

    276k GitHub stars~996 tokensUpdated today
    Testing & QAAuto-check passed
  • A skill your agent uses when you need to write or improve integration tests — including Testcontainers with @ServiceConnection, @DataJdbcTest persistence slices, TestRestTemplate or MockMvcTester…

    447 GitHub stars~935 tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • A skill your agent uses when you need framework-agnostic WireMock guidance — stub design, JSON or programmatic mappings, precise request matching, response bodies and faults, classpath fixtures…

    447 GitHub stars~1.1k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Java Testing

    HoangNguyen0403/agent-skills-standard

    Testing standards using JUnit 5, AssertJ, Mockito, Cucumber, and Spring Boot integration tests for Java.

    572 GitHub stars~1k tokensUpdated today
    Testing & QAAuto-check passed

More from rrezartprebreza/spring-boot-skills

All 51 skills in this repo
  • AI Observability

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when adding Spring AI-specific model observations, token usage, latency, externally configured cost attribution, advisor telemetry, or protected prompt and completion logging.

    301 GitHub stars~1.6k tokensUpdated 18 days ago
    Auto-check passed
  • API Versioning

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when versioning Spring MVC or WebFlux APIs in Spring Boot 3 / Spring Framework 6.

    301 GitHub stars~516 tokensUpdated 18 days ago
    Auto-check passed
  • API Versioning

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when versioning Spring MVC or WebFlux APIs in Spring Boot 4 / Spring Framework 7.

    301 GitHub stars~643 tokensUpdated 18 days ago
    Auto-check passed
  • Container Native Deployment

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when packaging a Spring Boot 3 application as an OCI image or GraalVM native executable.

    301 GitHub stars~781 tokensUpdated 18 days ago
    Auto-check passed
  • Container Native Deployment

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when packaging Spring Boot 4 as an OCI image, JVM container, AOT application, or GraalVM native executable.

    301 GitHub stars~706 tokensUpdated 18 days ago
    Auto-check passed
  • Domain Driven Design

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when evolving aggregate invariants, value objects or domain events in an existing DDD-style Spring Boot 3 application, or when DDD is explicitly requested.

    301 GitHub stars~2.1k tokensUpdated 18 days ago
    Auto-check passed

Works with

Questions about Testing Pyramid

What does Testing Pyramid do?

A skill your agent uses when writing tests of any kind — unit, slice, or integration. Testing Pyramid is an agent skill from rrezartprebreza/spring-boot-skills. Use when writing tests of any kind — unit, slice, or integration.

When should I use Testing Pyramid?

Testing Pyramid fits situations like: writing tests of any kind — unit; tasks that involve Integration testing; tasks that involve Backend development.

How do I install Testing Pyramid in Claude Code?

Run `npx skills add rrezartprebreza/spring-boot-skills --skill testing-pyramid -a claude-code`. Or copy the skill folder (skills/spring-boot-3/testing-pyramid in rrezartprebreza/spring-boot-skills) into .claude/skills/testing-pyramid in your project. Claude Code loads it when a task matches its description.

How do I install Testing Pyramid in Codex?

Run `npx skills add rrezartprebreza/spring-boot-skills --skill testing-pyramid -a codex`. Or copy the skill folder (skills/spring-boot-3/testing-pyramid in rrezartprebreza/spring-boot-skills) into .agents/skills/testing-pyramid in your project. Codex loads it when a task matches its description.

Can I use Testing Pyramid in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rrezartprebreza/spring-boot-skills --skill testing-pyramid -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing-pyramid, .gemini/skills/testing-pyramid, .github/skills/testing-pyramid and .opencode/skills/testing-pyramid in your project.

What does Testing Pyramid need to run?

Going by SKILL.md and its folder, Testing Pyramid needs Java for the scripts in its folder.

Does Testing Pyramid access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Testing Pyramid safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Testing Pyramid use?

Testing Pyramid is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing Pyramid use?

About 1.6k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Testing Pyramid?

Skills that share tags, products or a category with Testing Pyramid: Springboot Verification (affaan-m/ECC, 276k stars), Springboot TDD (affaan-m/ECC, 276k stars), Springboot TDD (affaan-m/ECC, 276k stars) and 322 Frameworks Spring Boot Testing Integration Tests (jabrena/plinth, 447 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing Pyramid?

rrezartprebreza (a GitHub user) maintains it in rrezartprebreza/spring-boot-skills, which has 301 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on September 21, 2026.

Source: rrezartprebreza/spring-boot-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.