Interface AssertableWebApplicationContext
- All Superinterfaces:
ApplicationContext, ApplicationContextAssertProvider<ConfigurableWebApplicationContext>, ApplicationEventPublisher, org.assertj.core.api.AssertProvider<ApplicationContextAssert<ConfigurableWebApplicationContext>>, AutoCloseable, BeanFactory, Closeable, ConfigurableApplicationContext, ConfigurableWebApplicationContext, EnvironmentCapable, HierarchicalBeanFactory, Lifecycle, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver, WebApplicationContext
public interface AssertableWebApplicationContext
extends ApplicationContextAssertProvider<ConfigurableWebApplicationContext>, ConfigurableWebApplicationContext
A
WebApplicationContext that additionally supports AssertJ style assertions.
Can be used to decorate an existing servlet web application context or an application
context that failed to start.
See ApplicationContextAssertProvider for more details.
- Since:
- 2.0.0
- Author:
- Phillip Webb
- See Also:
-
Field Summary
Fields inherited from interface BeanFactory
FACTORY_BEAN_PREFIX, FACTORY_BEAN_PREFIX_CHARFields inherited from interface ConfigurableApplicationContext
APPLICATION_STARTUP_BEAN_NAME, BOOTSTRAP_EXECUTOR_BEAN_NAME, CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, ENVIRONMENT_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SHUTDOWN_HOOK_THREAD_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAMEFields inherited from interface ConfigurableWebApplicationContext
APPLICATION_CONTEXT_ID_PREFIX, SERVLET_CONFIG_BEAN_NAMEFields inherited from interface ResourceLoader
CLASSPATH_URL_PREFIXFields inherited from interface ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX -
Method Summary
Static MethodsModifier and TypeMethodDescriptionget(Supplier<? extends ConfigurableWebApplicationContext> contextSupplier) Factory method to create a newAssertableWebApplicationContextinstance.get(Supplier<? extends ConfigurableWebApplicationContext> contextSupplier, Class<?>... additionalContextInterfaces) Factory method to create a newAssertableWebApplicationContextinstance.Methods inherited from interface ApplicationContext
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDateMethods inherited from interface ApplicationContextAssertProvider
assertThat, close, getSourceApplicationContext, getSourceApplicationContext, getStartupFailureMethods inherited from interface ApplicationEventPublisher
publishEvent, publishEventMethods inherited from interface BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getBean, getBean, getBeanProvider, getBeanProvider, getBeanProvider, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatchMethods inherited from interface ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addProtocolResolver, close, getApplicationStartup, getBeanFactory, getEnvironment, isActive, isClosed, pause, refresh, registerShutdownHook, removeApplicationListener, restart, setApplicationStartup, setClassLoader, setEnvironment, setId, setParentMethods inherited from interface ConfigurableWebApplicationContext
getConfigLocations, getNamespace, getServletConfig, setConfigLocation, setConfigLocations, setNamespace, setServletConfig, setServletContextMethods inherited from interface HierarchicalBeanFactory
containsLocalBean, getParentBeanFactoryMethods inherited from interface ListableBeanFactory
containsBeanDefinition, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotationMethods inherited from interface MessageSource
getMessage, getMessage, getMessageMethods inherited from interface ResourceLoader
getClassLoader, getResourceMethods inherited from interface ResourcePatternResolver
getResourcesMethods inherited from interface WebApplicationContext
getServletContext
-
Method Details
-
get
static AssertableWebApplicationContext get(Supplier<? extends ConfigurableWebApplicationContext> contextSupplier) Factory method to create a newAssertableWebApplicationContextinstance.- Parameters:
contextSupplier- a supplier that will either return a fully configuredConfigurableWebApplicationContextor throw an exception if the context fails to start.- Returns:
- a
AssertableWebApplicationContextinstance
-
get
static AssertableWebApplicationContext get(Supplier<? extends ConfigurableWebApplicationContext> contextSupplier, Class<?>... additionalContextInterfaces) Factory method to create a newAssertableWebApplicationContextinstance.- Parameters:
contextSupplier- a supplier that will either return a fully configuredConfigurableWebApplicationContextor throw an exception if the context fails to start.additionalContextInterfaces- and additional context interfaces to add to the proxy- Returns:
- a
AssertableWebApplicationContextinstance - Since:
- 3.4.0
-