クラス SourceFile
java.lang.ObjectSE
org.springframework.core.test.tools.DynamicFile
org.springframework.core.test.tools.SourceFile
- 実装済みのインターフェース一覧:
org.assertj.core.api.AssertProvider<SourceFileAssert>
public final class SourceFile
extends DynamicFile
implements org.assertj.core.api.AssertProvider<SourceFileAssert>
Java ソースコードを保持し、
SourceFileAssert サポートを提供する DynamicFile。通常、AOT で生成された型から作成されます。例:SourceFile.of(generatedFile::writeTo)
- 導入:
- 6.0
- 作成者:
- Phillip Webb, Scott Frederick
方法の概要
修飾子と型メソッド説明このメソッドを直接呼び出すのではなく、assertThat(sourceFile)を使用してください。static SourceFile指定されたClassのソースを検索して新しいSourceFileを作成するファクトリメソッド。static SourceFileforTestClass(ClassSE<?> type) 指定されたテストClassのソースを検索して、新しいSourceFileを作成するファクトリメソッド。完全修飾クラス名を返します。static SourceFileof(@Nullable StringSE path, CharSequenceSE charSequence) 指定されたCharSequenceSE から新しいSourceFileを作成するファクトリメソッド。static SourceFileof(@Nullable StringSE path, InputStreamSource inputStreamSource) 指定されたInputStreamSourceから新しいSourceFileを作成するファクトリメソッド。static SourceFileof(@Nullable StringSE path, WritableContent writableContent) 指定されたWritableContentから新しいSourceFileを作成するファクトリメソッド。static SourceFileof(CharSequenceSE charSequence) 指定されたCharSequenceSE から新しいSourceFileを作成するファクトリメソッド。static SourceFileof(InputStreamSource inputStreamSource) 指定されたInputStreamSourceから新しいSourceFileを作成するファクトリメソッド。static SourceFileof(WritableContent writableContent) 指定されたWritableContentから新しいSourceFileを作成するファクトリメソッド。クラス DynamicFile から継承されたメソッド
equals, getBytes, getContent, getPath, hashCode, toString, toString
メソッドの詳細
forTestClass
指定されたテストClassのソースを検索して、新しいSourceFileを作成するファクトリメソッド。- パラメーター:
type- ソースを取得するクラスファイル- 戻り値:
SourceFileインスタンス
forClass
指定されたClassのソースを検索して新しいSourceFileを作成するファクトリメソッド。- パラメーター:
sourceDirectory- ソースディレクトリtype- ソースを取得するクラスファイル- 戻り値:
SourceFileインスタンス
of
指定されたCharSequenceSE から新しいSourceFileを作成するファクトリメソッド。- パラメーター:
charSequence- ソースの内容を含むファイル- 戻り値:
SourceFileインスタンス
of
指定されたCharSequenceSE から新しいSourceFileを作成するファクトリメソッド。- パラメーター:
path- 推定されるパスを持つファイルまたはnullの相対パスcharSequence- ソースの内容を含むファイル- 戻り値:
SourceFileインスタンス
of
指定されたInputStreamSourceから新しいSourceFileを作成するファクトリメソッド。- パラメーター:
inputStreamSource- ファイルのソース- 戻り値:
SourceFileインスタンス
of
指定されたInputStreamSourceから新しいSourceFileを作成するファクトリメソッド。- パラメーター:
path- 推定されるパスを持つファイルまたはnullの相対パスinputStreamSource- ファイルのソース- 戻り値:
SourceFileインスタンス
of
指定されたWritableContentから新しいSourceFileを作成するファクトリメソッド。- パラメーター:
writableContent- ファイルに書き込む内容- 戻り値:
SourceFileインスタンス
of
指定されたWritableContentから新しいSourceFileを作成するファクトリメソッド。- パラメーター:
path- 推定されるパスを持つファイルまたはnullの相対パスwritableContent- ファイルに書き込む内容- 戻り値:
SourceFileインスタンス
getClassName
assertThat
このメソッドを直接呼び出すのではなく、assertThat(sourceFile)を使用してください。- 次で指定:
- インターフェース
org.assertj.core.api.AssertProvider<SourceFileAssert>のassertThat