クラス SpringBootTestContextBootstrapper
java.lang.ObjectSE
org.springframework.test.context.support.AbstractTestContextBootstrapper
org.springframework.test.context.support.DefaultTestContextBootstrapper
org.springframework.boot.test.context.SpringBootTestContextBootstrapper
- 実装されたすべてのインターフェース:
TestContextBootstrapper
Spring Boot の
TestContextBootstrapper
。@SpringBootTest
のサポートを提供し、直接使用またはサブクラス化することもできます。DefaultTestContextBootstrapper
に加えて、次の機能を提供します。default context loader
としてSpringBootContextLoader
を使用します。- 必要に応じて
@SpringBootConfiguration
を自動的に検索します。 - カスタム
Environment
getProperties(Class)
を定義できます。 - さまざまな
webEnvironment
モードをサポートします。
- 導入:
- 1.4.0
- 作成者:
- Phillip Webb, Andy Wilkinson, Brian Clozel, Madhura Bhave, Lorenzo Dee
- 関連事項:
コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected final MergedContextConfiguration
createModifiedConfig
(MergedContextConfiguration mergedConfig, ClassSE<?>[] classes) 異なるクラスで新しいMergedContextConfiguration
を作成します。protected final MergedContextConfiguration
createModifiedConfig
(MergedContextConfiguration mergedConfig, ClassSE<?>[] classes, StringSE[] propertySourceProperties) 異なるクラスとプロパティで新しいMergedContextConfiguration
を作成します。protected StringSE
determineResourceBasePath
(MergedContextConfiguration configuration) 指定されたconfiguration
のテストクラスに@WebAppConfiguration
(存在する場合)の値を使用して、Web アプリケーションのリソースベースパスを決定します。protected SpringBootTest
getAnnotation
(ClassSE<?> testClass) protected ClassSE<?>[]
getClasses
(ClassSE<?> testClass) protected ClassSE<? extends ContextLoader>
getDefaultContextLoaderClass
(ClassSE<?> testClass) protected StringSE
"differentiator" プロパティを返して、通常のテストとブートストラップテストを区別する何かがあることを確認します。protected ClassSE<?>[]
getOrFindConfigurationClasses
(MergedContextConfiguration mergedConfig) protected StringSE[]
getProperties
(ClassSE<?> testClass) protected SpringBootTest.WebEnvironment
getWebEnvironment
(ClassSE<?> testClass) このテストのSpringBootTest.WebEnvironment
型を返すか、未定義の場合は null を返します。protected MergedContextConfiguration
processMergedContextConfiguration
(MergedContextConfiguration mergedConfig) protected void
processPropertySourceProperties
(MergedContextConfiguration mergedConfig, ListSE<StringSE> propertySourceProperties) プロパティソースプロパティを後処理し、必要に応じて要素を追加または削除します。protected ContextLoader
resolveContextLoader
(ClassSE<?> testClass, ListSE<ContextConfigurationAttributes> configAttributesList) protected void
verifyConfiguration
(ClassSE<?> testClass) クラス org.springframework.test.context.support.AbstractTestContextBootstrapper から継承されたメソッド
buildMergedContextConfiguration, getBootstrapContext, getCacheAwareContextLoaderDelegate, getContextCustomizerFactories, getDefaultTestExecutionListeners, getTestExecutionListeners, resolveExplicitContextLoaderClass, setBootstrapContext
コンストラクターの詳細
SpringBootTestContextBootstrapper
public SpringBootTestContextBootstrapper()
メソッドの詳細
buildTestContext
- 次で指定:
- インターフェース
TestContextBootstrapper
のbuildTestContext
- オーバーライド:
- クラス
AbstractTestContextBootstrapper
のbuildTestContext
resolveContextLoader
protected ContextLoader resolveContextLoader(ClassSE<?> testClass, ListSE<ContextConfigurationAttributes> configAttributesList) - オーバーライド:
- クラス
AbstractTestContextBootstrapper
のresolveContextLoader
getDefaultContextLoaderClass
- オーバーライド:
- クラス
DefaultTestContextBootstrapper
のgetDefaultContextLoaderClass
processMergedContextConfiguration
protected MergedContextConfiguration processMergedContextConfiguration(MergedContextConfiguration mergedConfig) - オーバーライド:
- クラス
AbstractTestContextBootstrapper
のprocessMergedContextConfiguration
determineResourceBasePath
指定されたconfiguration
のテストクラスに@WebAppConfiguration
(存在する場合)の値を使用して、Web アプリケーションのリソースベースパスを決定します。存在しない場合のデフォルトはsrc/main/webapp
です。- パラメーター:
configuration
- 調べる構成- 戻り値:
- リソースの基本パス
- 導入:
- 2.1.6
getOrFindConfigurationClasses
getDifferentiatorPropertySourceProperty
"differentiator" プロパティを返して、通常のテストとブートストラップテストを区別する何かがあることを確認します。このプロパティがないと、このブートストラップによって作成されなかったキャッシュされたコンテキストが返される可能性があります。デフォルトでは、プロパティとしてブートストラップクラスを使用します。- 戻り値:
- 差別化要因または
null
processPropertySourceProperties
protected void processPropertySourceProperties(MergedContextConfiguration mergedConfig, ListSE<StringSE> propertySourceProperties) プロパティソースプロパティを後処理し、必要に応じて要素を追加または削除します。- パラメーター:
mergedConfig
- マージされたコンテキスト構成propertySourceProperties
- 処理するプロパティソースプロパティ
getWebEnvironment
このテストのSpringBootTest.WebEnvironment
型を返すか、未定義の場合は null を返します。- パラメーター:
testClass
- ソーステストクラス- 戻り値:
SpringBootTest.WebEnvironment
またはnull
getClasses
getProperties
getAnnotation
verifyConfiguration
createModifiedConfig
protected final MergedContextConfiguration createModifiedConfig(MergedContextConfiguration mergedConfig, ClassSE<?>[] classes) 異なるクラスで新しいMergedContextConfiguration
を作成します。- パラメーター:
mergedConfig
- ソース構成classes
- 置換クラス- 戻り値:
- 新しい
MergedContextConfiguration
createModifiedConfig
protected final MergedContextConfiguration createModifiedConfig(MergedContextConfiguration mergedConfig, ClassSE<?>[] classes, StringSE[] propertySourceProperties) 異なるクラスとプロパティで新しいMergedContextConfiguration
を作成します。- パラメーター:
mergedConfig
- ソース構成classes
- 置換クラスpropertySourceProperties
- 置換プロパティ- 戻り値:
- 新しい
MergedContextConfiguration