ApplicationContextAssertProvider
interface ApplicationContextAssertProvider<C : ApplicationContext?> : ApplicationContext, AssertProvider<A> , Closeable
An ApplicationContext that additionally supports AssertJ style assertions. Can be used to decorate an existing application context or an application context that failed to start.
Assertions can be applied using the standard AssertJ assertThat(...)
style (see ApplicationContextAssert for a complete list). For example:
assertThat(applicationContext).hasSingleBean(MyBean.class);
Content copied to clipboard
If the original ApplicationContext is needed for any reason the getSourceApplicationContext method can be used.
Any ApplicationContext method called on a context that has failed to start will throw an IllegalStateException.
Author
Phillip Webb
Since
2.0.0
Parameters
<C>
the application context type
See also
Inheritors
Functions
Link copied to clipboard
Return an assert for AspectJ.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun <A : Annotation?> findAllAnnotationsOnBean(beanName: String, annotationType: Class<A>, allowFactoryBeanInit: Boolean): Set<A>
Link copied to clipboard
Link copied to clipboard
open fun <T : ApplicationContextAssertProvider<C>?, C : ApplicationContext?> get(type: Class<T>, contextType: Class<out C>, contextSupplier: Supplier<out C>): T
open fun <T : ApplicationContextAssertProvider<C>?, C : ApplicationContext?> get(type: Class<T>, contextType: Class<out C>, contextSupplier: Supplier<out C>, additionalContextInterfaces: Array<Class<out Any>>): T
Factory method to create a new ApplicationContextAssertProvider instance.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun <T> getBeanProvider(requiredType: Class<T>, allowEagerInit: Boolean): ObjectProvider<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Return the original source ApplicationContext.
Return the original source ApplicationContext, casting it to the requested type.
Link copied to clipboard
Link copied to clipboard
Return the failure that caused application context to fail or
null
if the context started without issue.Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard