クラス ManualRestDocumentation
java.lang.ObjectSE
org.springframework.restdocs.ManualRestDocumentation
- 実装されているすべてのインターフェース:
RestDocumentationContextProvider
public final class ManualRestDocumentation
extends ObjectSE
implements RestDocumentationContextProvider
ManualRestDocumentation は、RestDocumentationContext を手動で管理するために使用されます。主に TestNG での使用を目的としていますが、コンテキストの手動管理が必要な環境での使用にも適しています。JUnit のユーザーは RestDocumentationExtension を使用し、コンテキストの自動管理のための Extension ベースのサポートを活用する必要があります。
- 導入:
- 1.1.0
- 作成者:
- Andy Wilkinson
コンストラクターの概要
コンストラクターコンストラクター説明<gradle/maven ビルドパス>/generated-snippets へのスニペットを生成する新しいManualRestDocumentationインスタンスを作成します。ManualRestDocumentation(StringSE outputDirectory) 指定されたoutputDirectoryへのスニペットを生成する新しいManualRestDocumentationインスタンスを作成します。方法の概要
修飾子と型メソッド説明voidテストが完了したことを通知します。実行しようとしている操作のRestDocumentationContextを返します。voidbeforeTest(ClassSE<?> testClass, StringSE testMethodName) テストが始まるという通知。
コンストラクターの詳細
ManualRestDocumentation
public ManualRestDocumentation()<gradle/maven ビルドパス>/generated-snippets へのスニペットを生成する新しいManualRestDocumentationインスタンスを作成します。ManualRestDocumentation
指定されたoutputDirectoryへのスニペットを生成する新しいManualRestDocumentationインスタンスを作成します。- パラメーター:
outputDirectory- 出力ディレクトリ
メソッドの詳細
beforeTest
テストが始まるという通知。指定されたtestMethodNameを使用して、指定されたtestClass上でテスト用のRestDocumentationContextを作成します。テストが完了したら、その後にafterTest()を呼び出す必要があります。- パラメーター:
testClass- テストクラスtestMethodName- テストメソッドの名前- 例外:
IllegalStateExceptionSE- コンテキストがすでに作成されている場合
afterTest
public void afterTest()テストが完了したことを通知します。beforeTest(Class, String)の呼び出しによって以前に確立されたRestDocumentationContextをクリアします。beforeOperation
インターフェースからコピーされた説明:RestDocumentationContextProvider実行しようとしている操作のRestDocumentationContextを返します。- 次で指定:
- インターフェース
RestDocumentationContextProviderのbeforeOperation - 戻り値:
- 操作のコンテキスト