Rename MockMvcTestClient to MockMvcWebTestClient
Closes gh-19647
This commit is contained in:
@@ -206,7 +206,7 @@ public class ExchangeResult {
|
||||
* Return the result from the mock server exchange, if applicable, for
|
||||
* further assertions on the state of the server response.
|
||||
* @since 5.3
|
||||
* @see org.springframework.test.web.servlet.client.MockMvcTestClient#resultActionsFor(ExchangeResult)
|
||||
* @see org.springframework.test.web.servlet.client.MockMvcWebTestClient#resultActionsFor(ExchangeResult)
|
||||
*/
|
||||
@Nullable
|
||||
public Object getMockServerResult() {
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcConfigurer;
|
||||
|
||||
/**
|
||||
* Base class for implementations of {@link MockMvcTestClient.MockMvcServerSpec}
|
||||
* Base class for implementations of {@link MockMvcWebTestClient.MockMvcServerSpec}
|
||||
* that simply delegates to a {@link ConfigurableMockMvcBuilder} supplied by
|
||||
* the concrete sub-classes.
|
||||
*
|
||||
@@ -35,8 +35,8 @@ import org.springframework.test.web.servlet.setup.MockMvcConfigurer;
|
||||
* @since 5.3
|
||||
* @param <B> the type of the concrete sub-class spec
|
||||
*/
|
||||
abstract class AbstractMockMvcServerSpec<B extends MockMvcTestClient.MockMvcServerSpec<B>>
|
||||
implements MockMvcTestClient.MockMvcServerSpec<B> {
|
||||
abstract class AbstractMockMvcServerSpec<B extends MockMvcWebTestClient.MockMvcServerSpec<B>>
|
||||
implements MockMvcWebTestClient.MockMvcServerSpec<B> {
|
||||
|
||||
@Override
|
||||
public <T extends B> T filters(Filter... filters) {
|
||||
|
||||
@@ -57,7 +57,7 @@ import org.springframework.web.util.pattern.PathPatternParser;
|
||||
* <p>Provides static factory methods and specs to initialize {@code MockMvc}
|
||||
* to which the {@code WebTestClient} connects to. For example:
|
||||
* <pre class="code">
|
||||
* WebTestClient client = MockMvcTestClient.bindToController(myController)
|
||||
* WebTestClient client = MockMvcWebTestClient.bindToController(myController)
|
||||
* .controllerAdvice(myControllerAdvice)
|
||||
* .validator(myValidator)
|
||||
* .build()
|
||||
@@ -65,7 +65,7 @@ import org.springframework.web.util.pattern.PathPatternParser;
|
||||
*
|
||||
* <p>The client itself can also be configured. For example:
|
||||
* <pre class="code">
|
||||
* WebTestClient client = MockMvcTestClient.bindToController(myController)
|
||||
* WebTestClient client = MockMvcWebTestClient.bindToController(myController)
|
||||
* .validator(myValidator)
|
||||
* .configureClient()
|
||||
* .baseUrl("/path")
|
||||
@@ -75,7 +75,7 @@ import org.springframework.web.util.pattern.PathPatternParser;
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 5.3
|
||||
*/
|
||||
public interface MockMvcTestClient {
|
||||
public interface MockMvcWebTestClient {
|
||||
|
||||
/**
|
||||
* Begin creating a {@link WebTestClient} by providing the {@code @Controller}
|
||||
@@ -128,7 +128,7 @@ public interface MockMvcTestClient {
|
||||
* .expectHeader().location("/persons/Joe")
|
||||
* .expectBody().isEmpty();
|
||||
*
|
||||
* MockMvcTestClient.resultActionsFor(result)
|
||||
* MockMvcWebTestClient.resultActionsFor(result)
|
||||
* .andExpect(model().size(1))
|
||||
* .andExpect(model().attributeExists("name"))
|
||||
* .andExpect(flash().attributeCount(1))
|
||||
@@ -38,13 +38,13 @@ import org.springframework.web.util.pattern.PathPatternParser;
|
||||
|
||||
/**
|
||||
* Simple wrapper around a {@link StandaloneMockMvcBuilder} that implements
|
||||
* {@link MockMvcTestClient.ControllerSpec}.
|
||||
* {@link MockMvcWebTestClient.ControllerSpec}.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 5.3
|
||||
*/
|
||||
class StandaloneMockMvcSpec extends AbstractMockMvcServerSpec<MockMvcTestClient.ControllerSpec>
|
||||
implements MockMvcTestClient.ControllerSpec {
|
||||
class StandaloneMockMvcSpec extends AbstractMockMvcServerSpec<MockMvcWebTestClient.ControllerSpec>
|
||||
implements MockMvcWebTestClient.ControllerSpec {
|
||||
|
||||
private final StandaloneMockMvcBuilder mockMvcBuilder;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user