org.springframework.test.web.servlet.phpunit

Class MockMvcWebClientBuilder

    • Method Detail

      • mockMvcSetup

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

        public MockMvcWebClientBuilder withDelegate(com.gargoylesoftware.phpunit.WebClient webClient)
        Supply the WebClient that the client built by this builder should delegate to when processing non-matching requests.
        Parameters:
        webClient - the WebClient to delegate to for requests that do not match; never null
        Returns:
        this builder for further customization
        See Also:
        build()
      • build

        public com.gargoylesoftware.phpunit.WebClient build()
        Build the WebClient configured via this builder.

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

        If a delegate has been explicitly configured, it will be used; otherwise, a default WebClient will be configured as the delegate.

        Returns:
        the WebClient to use
        See Also:
        withDelegate(WebClient)