# Test

> Test is an open-source agent skill for developer tools. Writes and extends JUnit 5 and Mockito tests for Sankhya Addon Studio backends. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/snk-devcenter/addon-studio/tree/main/plugins/addon-studio/skills/test
- **Repository:** https://github.com/snk-devcenter/addon-studio
- **GitHub stars:** 7
- **License:** MIT
- **Skill name:** test
- **Collection:** https://github.com/snk-devcenter/addon-studio
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill guides an agent through writing, reviewing and extending automated backend tests for Sankhya Addon Studio 2.0 projects. It covers a Gradle setup with JUnit 5, Mockito 4.11 for Java 8 projects, AssertJ and mockito-inline, plus templates for service, controller and mapper tests. It also documents static mocking of JapeSession and SessionFile.

The guidance focuses on pitfalls that break tests only on the server or under strict stubbing: checked exceptions thrown by JapeRepository methods, Lombok equals conflicts between stubbed entities, accented characters in exception messages, and UnnecessaryStubbingException in error paths. It also includes patterns for listener tests using real ModifingFields and DynamicVOPojo objects, and for checking CLOB and BLOB field mapping with EntityMapper.fromVO.

The skill expects a Java project with a src/test/java directory and Gradle. Tests run with the Gradle test task before deploying the addon.

## When your agent uses it

> Escreve, revisa e amplia testes JUnit 5 + Mockito 4.11 para Sankhya Addon Studio — mock de `JapeRepository` via `@Mock`, mock estático de `JapeSession`/`SessionFile` (mockito-inline), fixtures, controllers, services, repositories, mappers. Use ao criar, alterar, revisar ou ampliar cobertura de testes em `src/test/java/`, ao querer garantir que um comportamento, regra ou cálculo do addon não quebre numa mudança futura (regressão) — pedido que não diz "teste" mas pede proteção de código que já existe ("garantir que não quebre quando eu mexer", "não quero que isso regrida", "proteger esse cálculo", "ter segurança pra refatorar") é pedido de teste automatizado e é aqui, mesmo citando regra ou cálculo: as outras skills escrevem a regra, esta trava o comportamento dela; carregue antes de escrever qualquer teste do addon, mesmo simples: teste JUnit escrito de memória erra o stub de `JapeRepository` (`throws Exception` checked) e o mock estático de `JapeSession` —, ao travar o comportamento atual antes de refatorar,

## What it can access

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

- [Instructions only, no scripts](https://github.com/snk-devcenter/addon-studio/tree/HEAD/plugins/addon-studio/skills/test)
- [License: MIT](https://github.com/snk-devcenter/addon-studio/tree/HEAD/plugins/addon-studio/skills/test)

## Features

- **Gradle test setup:** Provides build file snippets for JUnit 5, Mockito and AssertJ with a readable test logger.
- **Repository stub rules:** Explains which JapeRepository methods throw checked exceptions and how tests must declare them.
- **Static mocking guidance:** Shows how to mock JapeSession and SessionFile static methods with mockito-inline safely.
- **Listener event tests:** Builds persistence events with real ModifingFields and DynamicVOPojo objects for listener checks.
- **CLOB and BLOB mapping checks:** Verifies that entity fields match the types the JAPE layer delivers, without a server.
- **Common stubbing pitfalls:** Covers Lombok equality clashes, strict stubbing errors and accent-safe message assertions.

## Good for

- Write unit tests for a new service class in an Addon Studio backend
- Add regression tests before refactoring a billing calculation
- Diagnose a failing test caused by a missing repository stub
- Check that a listener only updates the fields that changed
- Verify CLOB and BLOB fields map correctly in an entity

## Install

### Claude Code

This skill ships in the `addon-studio` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add snk-devcenter/addon-studio
/plugin install addon-studio@snk-devcenter
```

Or copy only this skill to `~/.claude/skills/test`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/test &&
cp -R "$tmp/plugins/addon-studio/skills/test" ~/.claude/skills/test &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/test` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/test` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/test &&
cp -R "$tmp/plugins/addon-studio/skills/test" ~/.agents/skills/test &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/test` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/test` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/test &&
cp -R "$tmp/plugins/addon-studio/skills/test" ~/.cursor/skills/test &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/test` 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/snk-devcenter/addon-studio.git --path plugins/addon-studio/skills/test
```

Or copy the folder to `~/.gemini/skills/test` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/test`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/test &&
cp -R "$tmp/plugins/addon-studio/skills/test" ~/.copilot/skills/test &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/test` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git
```

Then copy `addon-studio/plugins/addon-studio/skills/test` into your agent's skills folder as `test`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Which Mockito version does Test recommend and why?

It recommends Mockito 4.11.0 because the project targets Java 8, and Mockito 5.x requires Java 11 or newer.

### Do repository test methods need special exception handling?

Yes. JapeRepository methods such as findByPK and save declare throws Exception, so test methods that stub them must declare throws Exception as well.

### Can Test mock static SDK classes like JapeSession?

Yes, using mockito-inline with try-with-resources so the static mock is closed after each test.

### Does it test against a real database or Wildfly server?

No. It advises keeping unit tests free of real databases, Wildfly or external infrastructure, mocking the service boundaries instead.

### How do I install Test in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/test to use it in all your projects, or to .claude/skills/test in one project. Or install the addon-studio plugin, which includes it: /plugin marketplace add snk-devcenter/addon-studio, then /plugin install addon-studio@snk-devcenter.

### Does Test 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 Test?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Test?

The closest alternatives to Test are Junit 5 skill, Java junit, Spring boot testing, Sankhya utils and Entity.

## Where this comes from

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

## Alternatives

- [Junit 5 skill](https://ai-powered.com/skills/junit-5-skill): Junit 5 skill 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 boot testing](https://ai-powered.com/skills/spring-boot-testing): Spring boot testing is an open-source agent skill for developer tools.
- [Sankhya utils](https://ai-powered.com/skills/sankhya-utils): Sankhya utils is an open-source agent skill for developer tools.
- [Entity](https://ai-powered.com/skills/entity): Entity is an open-source agent skill for developer tools.
- [Repository](https://ai-powered.com/skills/repository): Repository is an open-source agent skill for developer tools.
- [Retrofit](https://ai-powered.com/skills/retrofit): Retrofit is an open-source agent skill for developer tools.
- [Controller](https://ai-powered.com/skills/controller): Controller is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/test-snk-devcenter
