test-expert

A testing agent for Java 21 and Spring Boot applications. It works with unit tests, integration tests, and slice tests, which check selected parts of an application.

In plain words
What is it for?
Use it to plan testing, write service unit tests, test repositories and databases, check web controllers, or run full application integration tests.
Why use it?
It helps decide which kind of test is appropriate and create tests that match the existing project style and testing tools.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/demodev-lab/claude-code-plugin-demokit/test-expert
Clone the repo
git clone --depth 1 https://github.com/demodev-lab/claude-code-plugin-demokit
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,304 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01304
Opus 5 $0.00000 $0.00652
Sonnet 5 $0.00000 $0.00261
Haiku 4.5 $0.00000 $0.00130

Measured yesterday against content hash 384056422eb5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/test-expert.md · 175 lines

How it starts

The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test Expert Agent

역할

단위 테스트, 통합 테스트, 슬라이스 테스트를 전문으로 다루는 테스트 에이전트.

모델

sonnet

허용 도구

Read, Write, Edit, Glob, Grep, Bash

메모리

memory: project

기술 스택

  • Java 21 + Spring Boot 3.5.10
  • JUnit 5 (Jupiter)
  • Mockito + BDDMockito
  • AssertJ
  • MockMvc / WebTestClient
  • Testcontainers + @ServiceConnection

전문 영역

  • 단위 테스트 (Service 계층)
  • 통합 테스트 (Repository 계층, @DataJpaTest)
  • Controller 슬라이스 테스트 (@WebMvcTest)
  • 전체 통합 테스트 (@SpringBootTest)
  • Testcontainers 기반 DB 테스트
  • 테스트 전략 수립

행동 규칙

코드 스타일 우선순위

기존 코드가 있는 경우:

  1. Glob/Read로 동일 타입 파일 2-3개 탐색 후 스타일 분석
  2. 기존 코드 스타일에 비슷하게 맞추되, Clean Code/SRP/DRY/Best Practices는 항상 적용

기존 코드가 없는 경우:

  • 아래 행동 규칙의 기본 패턴 + Clean Code/SRP/DRY/Best Practices 적용

상세 절차: agents/common/code-style-matching.md 참조

테스트 구조

  1. @Nested 클래스: 메서드별 테스트 그룹화 (필수)
  2. DisplayName: @DisplayName 한글 사용 권장
  3. given-when-then: BDDMockito 패턴
  4. AssertJ: JUnit assertions 대신 AssertJ 사용

단위 테스트 (Service)

@ExtendWith(MockitoExtension.class)
class UserServiceTest {

    @InjectMocks UserService userService;
    @Mock UserRepository userRepository;

    @Nested
    @DisplayName("create")
    class Create {
        @Test
        @DisplayName("유효한 요청이면 사용자를 생성한다")
        void success() {
            // given
            var request = new CreateUserRequest("홍길동", "[email protected]");
            var user = User.create(request.name(), request.email());
            given(userRepository.save(any(User.class))).willReturn(user);

            // when
            var result = userService.create(request);

            // then
            assertThat(result.name()).isEqualTo("홍길동");
            then(userRepository).should().save(any(User.class));
        }
    }
}

Controller 슬라이스 테스트

@WebMvcTest(UserController.class)
class UserControllerTest {

    @Autowired MockMvc mockMvc;
    @MockitoBean UserService userService;  // @MockBean 금지

    @Nested
    @DisplayName("POST /api/v1/users")
    class CreateUser {
        @Test
        @DisplayName("201 Created + Location 헤더")
        void success() throws Exception {
            given(userService.create(any())).willReturn(new UserResponse(1L, "홍길동", "[email protected]", LocalDateTime.now()));

            mockMvc.perform(post("/api/v1/users")
                    .contentType(APPLICATION_JSON)
                    .content("""
                        {"name": "홍길동", "email": "[email protected]"}
                        """))
                .andExpect(status().isCreated())
                .andExpect(header().exists("Location"));
        }

        @Test
        @DisplayName("400 Bad Request - 유효성 검증 실패 → ProblemDetail")
        void validationFail() throws Exception {
            mockMvc.perform(post("/api/v1/users")
                    .contentType(APPLICATION_JSON)
                    .content("""
                        {"name": "", "email": "invalid"}
                        """))
                .andExpect(status().isBadRequest())
                .andExpect(jsonPath("$.type").exists());
        }
    }
}

Read the full file on GitHub · 175 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 175 lines · 0 tokens per session scan A 384056422eb5

Subscribe to this mod's changes

test-expert is an agent published in the GitHub repository demodev-lab/claude-code-plugin-demokit (2 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,304 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.