リクエスト単体テスト・取引単体テストのコード例をJUnit 5化する - #716
Open
kumagoro1202 wants to merge 4 commits into
Open
Conversation
- 06_TestFWGuide の toctree で JUnit 5用拡張機能のページを概要の直後へ移動 - 01_Abstract の特徴「JUnit4ベース」を「JUnit 5で利用可能(推奨)+JUnit 4資産と互換」へ改訂 - 01_Abstract のテストメソッド記述方法を JUnit 5(org.junit.jupiter.api.Test)ベースへ更新 - テスティングフレームワークの入口ページに新規プロジェクト/既存プロジェクトの分岐案内を追加 - 昇格に合わせて JUnit5_Extension のページ題名を「JUnit 5での利用方法」へ変更 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- 05_UnitTestGuide/legacy_junit4: JUnit 4版コード例の入口ページを新設 - 06_TestFWGuide/legacy_junit4: JUnit 4での利用方法(継承モデルの書き方・ テスト種別と継承クラスの対応表)を新設 - 両セクションを各ガイドの toctree に追加 - 入口ページの既存プロジェクト向け案内を legacy_junit4 セクションへ誘導 既存のJUnit 4記述の本体は、各ページのJUnit 5化と合わせて順次本セクションへ 移設する(本コミットは骨格の新設のみ)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- 05_UnitTestGuide/01_ClassUnitTest 配下のコード例をJUnit 5 (@EntityTest/@DbAccessTest合成アノテーション+インジェクション方式)へ書き換え - Bean Validation対応Form/Entityクラス単体テスト - Nablarch Validation対応Form/Entityクラス単体テスト - Action/Componentクラス単体テスト - 従来のJUnit 4版(継承モデル)の3ページを legacy_junit4/ 配下へ移設 (ラベルにlegacy_junit4接頭辞を付与し、画像は既存ディレクトリを参照、 ダウンロード資材はlegacy側へ複製して自己完結化) - 各標準ページの冒頭にJUnit 4版への案内を追加 コード例のAPI(合成アノテーション+フィールドインジェクション+supportメソッド呼び出し)は nablarch-testing-junit5:2.1.0 に対して動作検証済み。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- 02_RequestUnitTest(ウェブ/REST/バッチ/メッセージング各方式)と
03_DealUnitTest(バッチ/メッセージング)のコード例を、JUnit 5の
合成アノテーション+インジェクション方式へ書き換え
- ウェブ: @BasicHttpRequestTest(baseUri=...)(getBaseUriオーバーライドを置換)
- REST: @RestTest/@SimpleRestTest(protectedメソッドはpublic版
readTextResource(Class, String)の使用を案内)
- バッチ: @BatchRequestTest、メッセージング: @MessagingRequestTest/
@MessagingReceiveTest
- JUnit 4版のテストクラス宣言パターン集を legacy_junit4/04_requestUnitTest として新設
- 誤記修正: MessagingRequestTestSupportのFQCNを実際のパッケージ
(nablarch.test.core.messaging)に合わせて修正(旧記載はnablarch.test.core.http)
- 誤記修正: 取引単体テスト(バッチ)のBatchRequestTestSupportのimport文の
パッケージをnablarch.test.core.batchへ修正
コード例のAPIは nablarch-testing-junit5:2.1.0 に対して動作検証済み
(no-arg execute()のテスト名解決は2.1.0のTestEventDispatcherExtensionの
実装で確認)。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
02_RequestUnitTest(ウェブ/REST/バッチ/メッセージング各方式)と03_DealUnitTest(バッチ/メッセージング)のコード例を、JUnit 5の合成アノテーション+インジェクション方式へ書き換えます。
誤記修正(本文の記載とソースコードの乖離):
引数なしexecute()のテストメソッド名からのシート名解決は、nablarch-testing-junit5 2.1.0のTestEventDispatcherExtensionの実装(JUnit 4のTestNameルールをJUnit 5のテストメソッド名で再現)で動作を確認しています。
マージ順序について: 本PRはスタックPRであり、先行PR 1-3(
junit5-docs/1-3-classunittest)までの内容を含みます。マージ順序は 1-1 → 1-2 → 1-3 → 1-4 → 1-5 → 1-6 → 1-7 → 1-8 を厳守してください。先行PRがマージされるまで、本PRの差分表示には先行PR分の変更が含まれます。