Class AcrossTestWebContext

All Implemented Interfaces:
AcrossContextBeanRegistry, Closeable, AutoCloseable

public class AcrossTestWebContext extends AcrossTestContext
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:
  • Constructor Details

    • AcrossTestWebContext

      protected AcrossTestWebContext()
  • Method Details

    • getServletContext

      public MockAcrossServletContext getServletContext()
      Retrieve the MockAcrossServletContext that was set. If dynamic registration was enabled, the instance can be queried for servlet registrations.
      Returns:
      servletContext instance
    • setServletContext

      protected void setServletContext(MockAcrossServletContext servletContext)
    • mockMvc

      public org.springframework.test.web.servlet.MockMvc mockMvc()
      Returns an initialized MockMvc for the internal AcrossContext. All filters registered on the MockAcrossServletContext will be added to this MockMvc instance.
      Returns:
      instance ready for mock requests
    • setApplicationContext

      protected void setApplicationContext(org.springframework.context.ConfigurableApplicationContext applicationContext)
      Overrides:
      setApplicationContext in class AcrossTestContext