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
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve theMockAcrossServletContext
that was set.org.springframework.test.web.servlet.MockMvc
mockMvc()
Returns an initializedMockMvc
for the internalAcrossContext
.protected void
setApplicationContext
(org.springframework.context.ConfigurableApplicationContext applicationContext) protected void
setServletContext
(MockAcrossServletContext servletContext) Methods inherited from class com.foreach.across.test.AcrossTestContext
close, contextInfo, setAcrossContext
Methods 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 theMockAcrossServletContext
that 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 initializedMockMvc
for the internalAcrossContext
. All filters registered on theMockAcrossServletContext
will be added to thisMockMvc
instance.- Returns:
- instance ready for mock requests
-
setApplicationContext
protected void setApplicationContext(org.springframework.context.ConfigurableApplicationContext applicationContext) - Overrides:
setApplicationContext
in classAcrossTestContext
-