メインコンテンツへスキップ
kitlocal.dev

Write JUnit 5 tests for a Java class

Generates a focused JUnit 5 test class (with Mockito when needed) for one class, covering the happy path, edge cases and failure modes, and explains what it did not cover.

このリソースは英語のみで提供されています。

プロンプトは、ご自身のアシスタントにコピーして使うテキストです。KitLocal はプロンプトを実行しません。

変数を入力

入力した内容はこのブラウザ内にのみ残り、URL への追加、保存、外部への送信は行われません。

プレビュー

未入力: Class under test

Write a JUnit 5 test class for the Java class below.

Assertion style: AssertJ
Use Mockito for collaborators: yes

Rules:
- One behavior per test; name tests as should_<behavior>_when_<condition>.
- Cover the happy path, boundary values, null/empty input, and each exception path.
- Do not test private methods directly and do not assert on implementation details.
- Prefer small inline fixtures over shared mutable state.
- After the code, list behaviors you deliberately did NOT test and why.

Collaborators:


Class under test:
```java
{{classUnderTest}}
```

目的

Draft a first, reviewable test class so you start from a solid skeleton instead of a blank file.

使う場面

  • A class has little or no coverage and you need a starting point.
  • You want edge cases you might not think of listed explicitly.

準備するもの

  • The class under test and the signatures of its direct collaborators.
  • Your assertion library preference.

期待される出力

A single compilable Java test class in one code block, followed by a short "Not covered" list.

このカタログについて

同梱スナップショット · 2026/11/15 6:05 に公開 · カタログのリビジョン 5bc079fe355af2214bc0

アプリに同梱されたスナップショットを表示しています(コンテンツソースが設定されていません)。ソース側にはより新しいコンテンツがある可能性があります。