クラス 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 SourceFile
forTestClass
(ClassSE<?> type) 指定されたテストClass
のソースを検索して、新しいSourceFile
を作成するファクトリメソッド。完全修飾クラス名を返します。static SourceFile
of
(CharSequenceSE charSequence) 指定されたCharSequence
SE から新しいSourceFile
を作成するファクトリメソッド。static SourceFile
of
(StringSE path, CharSequenceSE charSequence) 指定されたCharSequence
SE から新しいSourceFile
を作成するファクトリメソッド。static SourceFile
of
(StringSE path, InputStreamSource inputStreamSource) 指定されたInputStreamSource
から新しいSourceFile
を作成するファクトリメソッド。static SourceFile
of
(StringSE path, WritableContent writableContent) 指定されたWritableContent
から新しいSourceFile
を作成するファクトリメソッド。static SourceFile
of
(InputStreamSource inputStreamSource) 指定されたInputStreamSource
から新しいSourceFile
を作成するファクトリメソッド。static SourceFile
of
(WritableContent writableContent) 指定されたWritableContent
から新しいSourceFile
を作成するファクトリメソッド。クラス org.springframework.core.test.tools.DynamicFile から継承されたメソッド
equals, getBytes, getContent, getPath, hashCode, toString, toString
メソッドの詳細
forTestClass
指定されたテストClass
のソースを検索して、新しいSourceFile
を作成するファクトリメソッド。- パラメーター:
type
- ソースを取得するクラスファイル- 戻り値:
SourceFile
インスタンス
forClass
指定されたClass
のソースを検索して新しいSourceFile
を作成するファクトリメソッド。- パラメーター:
sourceDirectory
- ソースディレクトリtype
- ソースを取得するクラスファイル- 戻り値:
SourceFile
インスタンス
of
指定されたCharSequence
SE から新しいSourceFile
を作成するファクトリメソッド。- パラメーター:
charSequence
- ソースの内容を含むファイル- 戻り値:
SourceFile
インスタンス
of
指定されたCharSequence
SE から新しい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