spring-framework / org.springframework.test.context.support / DefaultTestContext / getApplicationContext

getApplicationContext

open fun getApplicationContext(): ApplicationContext

Get the ApplicationContext for this test context.

The default implementation delegates to the CacheAwareContextLoaderDelegate that was supplied when this TestContext was constructed.

Exceptions

IllegalStateException - if the context returned by the context loader delegate is not active (i.e., has been closed).

See Also
CacheAwareContextLoaderDelegate#loadContext