インターフェース ApplicationContextAssertProvider<C extends ApplicationContext>
- 型パラメーター:
C- アプリケーションコンテキスト型
- すべてのスーパーインターフェース:
ApplicationContext、ApplicationEventPublisher、org.assertj.core.api.AssertProvider<ApplicationContextAssert<C>>、AutoCloseableSE、BeanFactory、CloseableSE、EnvironmentCapable、HierarchicalBeanFactory、ListableBeanFactory、MessageSource、ResourceLoader、ResourcePatternResolver
- すべての既知のサブインターフェース:
AssertableApplicationContext、AssertableReactiveWebApplicationContext、AssertableWebApplicationContext
public interface ApplicationContextAssertProvider<C extends ApplicationContext>
extends ApplicationContext, org.assertj.core.api.AssertProvider<ApplicationContextAssert<C>>, CloseableSE
AssertJ スタイルのアサーションをさらにサポートする
ApplicationContext。既存のアプリケーションコンテキストまたは起動に失敗したアプリケーションコンテキストを装飾するために使用できます。 アサーションは、標準の AssertJ assertThat(...) スタイルを使用して適用できます(完全なリストについては、ApplicationContextAssert を参照してください)。例:
assertThat(applicationContext).hasSingleBean(MyBean.class);
何らかの理由で元の ApplicationContext が必要な場合は、getSourceApplicationContext() メソッドを使用できます。
起動に失敗したコンテキストで呼び出された ApplicationContext メソッドは、IllegalStateExceptionSE をスローします。
- 導入:
- 2.0.0
- 作成者:
- Phillip Webb
- 関連事項:
フィールドのサマリー
インターフェース org.springframework.beans.factory.BeanFactory から継承されたフィールド
FACTORY_BEAN_PREFIX, FACTORY_BEAN_PREFIX_CHARインターフェース org.springframework.core.io.ResourceLoader から継承されたフィールド
CLASSPATH_URL_PREFIXインターフェース org.springframework.core.io.support.ResourcePatternResolver から継承されたフィールド
CLASSPATH_ALL_URL_PREFIXメソッドのサマリー
修飾子と型メソッド説明使用すべきではありません。誤って使用しないようにします。voidclose()static <T extends ApplicationContextAssertProvider<C>,C extends ApplicationContext>
Tget(ClassSE<T> type, ClassSE<? extends C> contextType, SupplierSE<? extends C> contextSupplier) 新しいApplicationContextAssertProviderインスタンスを作成するファクトリメソッド。static <T extends ApplicationContextAssertProvider<C>,C extends ApplicationContext>
Tget(ClassSE<T> type, ClassSE<? extends C> contextType, SupplierSE<? extends C> contextSupplier, ClassSE<?>... additionalContextInterfaces) 新しいApplicationContextAssertProviderインスタンスを作成するファクトリメソッド。元のソースApplicationContextを返します。<T extends C>
TgetSourceApplicationContext(ClassSE<T> requiredType) 元のソースApplicationContextを返し、リクエストされた型にキャストします。アプリケーションコンテキストの失敗の原因となった障害、またはコンテキストが課題なく開始された場合はnullを返します。インターフェース org.springframework.context.ApplicationContext から継承されたメソッド
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDateインターフェース org.springframework.context.ApplicationEventPublisher から継承されたメソッド
publishEvent, publishEventインターフェース org.springframework.beans.factory.BeanFactory から継承されたメソッド
containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatchインターフェース org.springframework.core.env.EnvironmentCapable から継承されたメソッド
getEnvironmentインターフェース org.springframework.beans.factory.HierarchicalBeanFactory から継承されたメソッド
containsLocalBean, getParentBeanFactoryインターフェース org.springframework.beans.factory.ListableBeanFactory から継承されたメソッド
containsBeanDefinition, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotationインターフェース org.springframework.context.MessageSource から継承されたメソッド
getMessage, getMessage, getMessageインターフェース org.springframework.core.io.ResourceLoader から継承されたメソッド
getClassLoader, getResourceインターフェース org.springframework.core.io.support.ResourcePatternResolver から継承されたメソッド
getResources
メソッドの詳細
assertThat
使用すべきではありません。誤って使用しないようにしてください。代わりに、標準の AssertJassertThat(context)...呼び出しを優先してください。AspectJ のアサートを返します。- 次で指定:
- インターフェース
org.assertj.core.api.AssertProvider<C extends ApplicationContext>のassertThat - 戻り値:
- AspectJ アサート
getSourceApplicationContext
C getSourceApplicationContext()元のソースApplicationContextを返します。- 戻り値:
- ソースアプリケーションコンテキスト
- 例外:
IllegalStateExceptionSE- ソースコンテキストの開始に失敗した場合
getSourceApplicationContext
元のソースApplicationContextを返し、リクエストされた型にキャストします。- 型パラメーター:
T- コンテキスト型- パラメーター:
requiredType- 必要なコンテキスト型- 戻り値:
- ソースアプリケーションコンテキスト
- 例外:
IllegalStateExceptionSE- ソースコンテキストの開始に失敗した場合
getStartupFailure
ThrowableSE getStartupFailure()アプリケーションコンテキストの失敗の原因となった障害、またはコンテキストが課題なく開始された場合はnullを返します。- 戻り値:
- 起動失敗または
null
close
void close()- 次で指定:
- インターフェース
AutoCloseableSEのclose - 次で指定:
- インターフェース
CloseableSEのclose
get
static <T extends ApplicationContextAssertProvider<C>,C extends ApplicationContext> T get(ClassSE<T> type, ClassSE<? extends C> contextType, SupplierSE<? extends C> contextSupplier) 新しいApplicationContextAssertProviderインスタンスを作成するファクトリメソッド。- 型パラメーター:
T- アサートプロバイダー型C- コンテキスト型- パラメーター:
type- 必要なApplicationContextAssertProviderの型 (インターフェースでなければなりません)contextType- 管理されているApplicationContextの型 (インターフェースでなければなりません)contextSupplier- 完全に構成されたApplicationContextを返すか、コンテキストの開始に失敗した場合に例外をスローするサプライヤー。- 戻り値:
ApplicationContextAssertProviderインスタンス
get
static <T extends ApplicationContextAssertProvider<C>,C extends ApplicationContext> T get(ClassSE<T> type, ClassSE<? extends C> contextType, SupplierSE<? extends C> contextSupplier, ClassSE<?>... additionalContextInterfaces) 新しいApplicationContextAssertProviderインスタンスを作成するファクトリメソッド。- 型パラメーター:
T- アサートプロバイダー型C- コンテキスト型- パラメーター:
type- 必要なApplicationContextAssertProviderの型 (インターフェースでなければなりません)contextType- 管理されているApplicationContextの型 (インターフェースでなければなりません)contextSupplier- 完全に構成されたApplicationContextを返すか、コンテキストの開始に失敗した場合に例外をスローするサプライヤー。additionalContextInterfaces- プロキシに追加する追加のコンテキストインターフェース- 戻り値:
ApplicationContextAssertProviderインスタンス- 導入:
- 3.4.0