Package com.foreach.across.test
Class AcrossTestWebContext
java.lang.Object
com.foreach.across.core.context.registry.DefaultAcrossContextBeanRegistry
com.foreach.across.test.AcrossTestContext
com.foreach.across.test.AcrossTestWebContext
- All Implemented Interfaces:
AcrossContextBeanRegistry,Closeable,AutoCloseable
Extends the default
AcrossTestContext with support for web configurations.
This class assumes that the configured AcrossContext was configured using
a MockAcrossServletContext and with WebApplicationContext support.
Instances of this class should not be created manually but through one of the builders.
See AcrossTestBuilders.
Public constructors will be removes in a future release.
- Author:
- Arne Vandamme
- See Also:
-
Field Summary
Fields inherited from interface com.foreach.across.core.context.registry.AcrossContextBeanRegistry
BEAN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve theMockAcrossServletContextthat was set.org.springframework.test.web.servlet.MockMvcmockMvc()Returns an initializedMockMvcfor the internalAcrossContext.protected voidsetApplicationContext(org.springframework.context.ConfigurableApplicationContext applicationContext) protected voidsetServletContext(MockAcrossServletContext servletContext) Methods inherited from class com.foreach.across.test.AcrossTestContext
close, contextInfo, setAcrossContextMethods inherited from class com.foreach.across.core.context.registry.DefaultAcrossContextBeanRegistry
containsBean, findBeanOfTypeFromModule, getBean, getBean, getBeanFromModule, getBeanOfType, getBeanOfTypeFromModule, getBeansOfType, getBeansOfType, getBeansOfType, getBeansOfTypeAsMap, getBeansOfTypeAsMap, getBeansOfTypeAsMap, getBeanType, getBeanTypeFromModule, getContextId, getContextInfo, getFactoryName, moduleContainsLocalBean, setContextInfo
-
Constructor Details
-
AcrossTestWebContext
protected AcrossTestWebContext()
-
-
Method Details
-
getServletContext
Retrieve theMockAcrossServletContextthat was set. If dynamic registration was enabled, the instance can be queried for servlet registrations.- Returns:
- servletContext instance
-
setServletContext
-
mockMvc
public org.springframework.test.web.servlet.MockMvc mockMvc()Returns an initializedMockMvcfor the internalAcrossContext. All filters registered on theMockAcrossServletContextwill be added to thisMockMvcinstance.- Returns:
- instance ready for mock requests
-
setApplicationContext
protected void setApplicationContext(org.springframework.context.ConfigurableApplicationContext applicationContext) - Overrides:
setApplicationContextin classAcrossTestContext
-