public interface AssertableApplicationContext
ApplicationContext that additionally supports AssertJ style assertions. Can
be used to decorate and existing application context or an application context that
failed to start.
See AssertProviderApplicationContext for more details.
ApplicationContextTester,
ApplicationContextFACTORY_BEAN_PREFIXCLASSPATH_ALL_URL_PREFIXCLASSPATH_URL_PREFIX| Modifier and Type | Method and Description |
|---|---|
ApplicationContextAssert<C> |
assertThat()
Deprecated.
use standard AssertJ
assertThat(context)... calls instead. |
void |
close() |
static <T extends org.springframework.boot.test.context.AssertProviderApplicationContext<C>,C extends ApplicationContext> |
get(Class<T> type,
Class<? extends C> contextType,
Supplier<? extends C> contextSupplier)
Factory method to create a new
AssertProviderApplicationContext instance. |
static AssertableApplicationContext |
get(Supplier<? extends ConfigurableApplicationContext> contextSupplier)
Factory method to create a new
AssertableApplicationContext instance. |
C |
getSourceApplicationContext()
Return the original source
ApplicationContext. |
<T extends C> |
getSourceApplicationContext(Class<T> requiredType)
Return the original source
ApplicationContext, casting it to the requested
type. |
Throwable |
getStartupFailure()
Return the failure that caused application context to fail or
null if the
context started without issue. |
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDategetEnvironmentcontainsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotationcontainsLocalBean, getParentBeanFactorycontainsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatchgetMessage, getMessage, getMessagepublishEvent, publishEventgetResourcesgetClassLoader, getResourcestatic AssertableApplicationContext get(Supplier<? extends ConfigurableApplicationContext> contextSupplier)
AssertableApplicationContext instance.contextSupplier - a supplier that will either return a fully configured
ConfigurableApplicationContext or throw an exception if the context fails
to start.AssertableApplicationContext instance@Deprecated ApplicationContextAssert<C> assertThat()
assertThat(context)... calls instead.assertThat in interface org.assertj.core.api.AssertProvider<ApplicationContextAssert<C extends ApplicationContext>>C getSourceApplicationContext()
ApplicationContext.IllegalStateException - if the source context failed to start<T extends C> T getSourceApplicationContext(Class<T> requiredType)
ApplicationContext, casting it to the requested
type.T - the context typerequiredType - the required context typeIllegalStateException - if the source context failed to startThrowable getStartupFailure()
null if the
context started without issue.nullvoid close()
close in interface AutoCloseableclose in interface Closeablestatic <T extends org.springframework.boot.test.context.AssertProviderApplicationContext<C>,C extends ApplicationContext> T get(Class<T> type, Class<? extends C> contextType, Supplier<? extends C> contextSupplier)
AssertProviderApplicationContext instance.T - the assert provider typeC - the context typetype - the type of AssertProviderApplicationContext required (must be
an interface)contextType - the type of ApplicationContext being managed (must be an
interface)contextSupplier - a supplier that will either return a fully configured
ApplicationContext or throw an exception if the context fails to start.AssertProviderApplicationContext instanceCopyright © 2017 Pivotal Software, Inc.. All rights reserved.