org.springframework.test.web.servlet.phpunit.webdriver

Class MockMvcHtmlUnitDriverBuilder

    • Method Detail

      • mockMvcSetup

        public static MockMvcHtmlUnitDriverBuilder mockMvcSetup(MockMvc mockMvc)
        Create a new MockMvcHtmlUnitDriverBuilder based on the supplied MockMvc instance.
        Parameters:
        mockMvc - the MockMvc instance to use (never null)
        Returns:
        the MockMvcHtmlUnitDriverBuilder to customize
      • javascriptEnabled

        public MockMvcHtmlUnitDriverBuilder javascriptEnabled(boolean javascriptEnabled)
        Specify whether JavaScript should be enabled.

        Default is true.

        Parameters:
        javascriptEnabled - true if JavaScript should be enabled
        Returns:
        this builder for further customizations
        See Also:
        build()
      • withDelegate

        public MockMvcHtmlUnitDriverBuilder withDelegate(WebConnectionHtmlUnitDriver driver)
        Supply the WebConnectionHtmlUnitDriver that the driver built by this builder should delegate to when processing non-matching requests.
        Parameters:
        driver - the WebConnectionHtmlUnitDriver to delegate to for requests that do not match (never null)
        Returns:
        this builder for further customizations
        See Also:
        build()
      • build

        public org.openqa.selenium.phpunit.HtmlUnitDriver build()
        Build the HtmlUnitDriver configured via this builder.

        The returned driver will use the configured MockMvc instance for processing any matching requests and a delegate HtmlUnitDriver for all other requests.

        If a delegate has been explicitly configured, it will be used; otherwise, a default WebConnectionHtmlUnitDriver with the BrowserVersion set to CHROME will be configured as the delegate.

        Returns:
        the HtmlUnitDriver to use
        See Also:
        withDelegate(WebConnectionHtmlUnitDriver)