public class SpringBootTestContextBootstrapper extends DefaultTestContextBootstrapper
TestContextBootstrapper
。@SpringBootTest
のサポートを提供し、直接使用またはサブクラス化することもできます。DefaultTestContextBootstrapper
に加えて、次の機能を提供します。default context loader
として SpringBootContextLoader
を使用します。@SpringBootConfiguration
を自動的に検索します。Environment
getProperties(Class)
を定義できます。webEnvironment
モードをサポートします。SpringBootTest
, TestConfiguration
コンストラクターと説明 |
---|
SpringBootTestContextBootstrapper() |
buildMergedContextConfiguration, getBootstrapContext, getCacheAwareContextLoaderDelegate, getContextCustomizerFactories, getDefaultTestExecutionListenerClassNames, getTestExecutionListeners, resolveExplicitContextLoaderClass, setBootstrapContext
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public TestContext buildTestContext()
TestContextBootstrapper
の buildTestContext
AbstractTestContextBootstrapper
の buildTestContext
protected SetSE<ClassSE<? extends TestExecutionListener>> getDefaultTestExecutionListenerClasses()
protected ContextLoader resolveContextLoader(ClassSE<?> testClass, ListSE<ContextConfigurationAttributes> configAttributesList)
AbstractTestContextBootstrapper
の resolveContextLoader
protected ClassSE<? extends ContextLoader> getDefaultContextLoaderClass(ClassSE<?> testClass)
DefaultTestContextBootstrapper
の getDefaultContextLoaderClass
protected MergedContextConfiguration processMergedContextConfiguration(MergedContextConfiguration mergedConfig)
AbstractTestContextBootstrapper
の processMergedContextConfiguration
protected StringSE determineResourceBasePath(MergedContextConfiguration configuration)
configuration
のテストクラスに @WebAppConfiguration
(存在する場合)の値を使用して、Web アプリケーションのリソースベースパスを決定します。存在しない場合のデフォルトは src/main/webapp
です。configuration
- 調べる構成 protected ClassSE<?>[] getOrFindConfigurationClasses(MergedContextConfiguration mergedConfig)
protected StringSE getDifferentiatorPropertySourceProperty()
null
protected void processPropertySourceProperties(MergedContextConfiguration mergedConfig, ListSE<StringSE> propertySourceProperties)
mergedConfig
- マージされたコンテキスト構成 propertySourceProperties
- 処理するプロパティソースプロパティ protected SpringBootTest.WebEnvironment getWebEnvironment(ClassSE<?> testClass)
SpringBootTest.WebEnvironment
型を返すか、未定義の場合は null を返します。testClass
- ソーステストクラス SpringBootTest.WebEnvironment
または null
protected SpringBootTest getAnnotation(ClassSE<?> testClass)
protected void verifyConfiguration(ClassSE<?> testClass)
protected final MergedContextConfiguration createModifiedConfig(MergedContextConfiguration mergedConfig, ClassSE<?>[] classes)
MergedContextConfiguration
を作成します。mergedConfig
- ソース構成 classes
- 置換クラス MergedContextConfiguration
protected final MergedContextConfiguration createModifiedConfig(MergedContextConfiguration mergedConfig, ClassSE<?>[] classes, StringSE[] propertySourceProperties)
MergedContextConfiguration
を作成します。mergedConfig
- ソース構成 classes
- 置換クラス propertySourceProperties
- 置換プロパティ MergedContextConfiguration