C - アプリケーションコンテキスト型 public interface ApplicationContextAssertProvider<C extends org.springframework.context.ApplicationContext> extends org.springframework.context.ApplicationContext, org.assertj.core.api.AssertProvider<ApplicationContextAssert<C>>, CloseableSE
ApplicationContext。既存のアプリケーションコンテキストまたは起動に失敗したアプリケーションコンテキストを装飾するために使用できます。 アサーションは、標準の AssertJ assertThat(...) スタイルを使用して適用できます(完全なリストについては、ApplicationContextAssert を参照してください)。例:
assertThat(applicationContext).hasSingleBean(MyBean.class);
何らかの理由で元の ApplicationContext が必要な場合は、getSourceApplicationContext() メソッドを使用できます。
開始に失敗したコンテキストで呼び出された ApplicationContext メソッドは、IllegalStateExceptionSE をスローします。
AssertableApplicationContext, AssertableWebApplicationContext, AssertableReactiveWebApplicationContext, ApplicationContextAssert| 修飾子と型 | メソッドと説明 |
|---|---|
ApplicationContextAssert<C> | assertThat() 使用すべきではありません。 誤って使用しないようにしてください。代わりに、標準の AssertJ assertThat(context)... 呼び出しを優先してください。 |
void | close() |
static <T extends ApplicationContextAssertProvider<C>,C extends org.springframework.context.ApplicationContext> | get(ClassSE<T> type, ClassSE<? extends C> contextType, SupplierSE<? extends C> contextSupplier) 新しい ApplicationContextAssertProvider インスタンスを作成するファクトリメソッド。 |
C | getSourceApplicationContext() 元のソース ApplicationContext を返します。 |
<T extends C> | getSourceApplicationContext(ClassSE<T> requiredType) 元のソース ApplicationContext を返し、リクエストされた型にキャストします。 |
ThrowableSE | getStartupFailure() アプリケーションコンテキストの失敗の原因となった障害、またはコンテキストが課題なく開始された場合は null を返します。 |
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDatecontainsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotationcontainsLocalBean, getParentBeanFactorycontainsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch@DeprecatedSE ApplicationContextAssert<C> assertThat()
assertThat(context)... 呼び出しを使用してください。org.assertj.core.api.AssertProvider<ApplicationContextAssert<C extends org.springframework.context.ApplicationContext>> 内の assertThat C getSourceApplicationContext()
ApplicationContext を返します。IllegalStateExceptionSE - ソースコンテキストの開始に失敗した場合 <T extends C> T getSourceApplicationContext(ClassSE<T> requiredType)
ApplicationContext を返し、リクエストされた型にキャストします。T - コンテキスト型 requiredType - 必要なコンテキスト型 IllegalStateExceptionSE - ソースコンテキストの開始に失敗した場合 ThrowableSE getStartupFailure()
null を返します。nullvoid close()
AutoCloseableSE 内の closeSE CloseableSE 内の closeSE static <T extends ApplicationContextAssertProvider<C>,C extends org.springframework.context.ApplicationContext> T get(ClassSE<T> type, ClassSE<? extends C> contextType, SupplierSE<? extends C> contextSupplier)
ApplicationContextAssertProvider インスタンスを作成するファクトリメソッド。T - アサートプロバイダー型 C - コンテキスト型 type - 必要な ApplicationContextAssertProvider の型 (インターフェースでなければなりません)contextType - 管理されている ApplicationContext の型 (インターフェースでなければなりません)contextSupplier - 完全に構成された ApplicationContext を返すか、コンテキストの開始に失敗した場合に例外をスローするサプライヤー。ApplicationContextAssertProvider インスタンス Copyright © 2019 Pivotal Software, Inc.. All rights reserved.