Fix cross references
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
Dependency injection should make your code less dependent on the container than it would
|
||||
be with traditional J2EE / Java EE development. The POJOs that make up your application
|
||||
should be testable in JUnit or TestNG tests, with objects instantiated by using the `new`
|
||||
operator, without Spring or any other container. You can use <<mock-objects, mock objects>>
|
||||
operator, without Spring or any other container. You can use xref:testing/unit.adoc#mock-objects[mock objects]
|
||||
(in conjunction with other valuable testing techniques) to test your code in isolation.
|
||||
If you follow the architecture recommendations for Spring, the resulting clean layering
|
||||
and componentization of your codebase facilitate easier unit testing. For example,
|
||||
@@ -25,10 +25,10 @@ are described in this chapter.
|
||||
|
||||
Spring includes a number of packages dedicated to mocking:
|
||||
|
||||
* <<mock-objects-env>>
|
||||
* <<mock-objects-jndi>>
|
||||
* <<mock-objects-servlet>>
|
||||
* <<mock-objects-web-reactive>>
|
||||
* xref:testing/unit.adoc#mock-objects-env[Environment]
|
||||
* xref:testing/unit.adoc#mock-objects-jndi[JNDI]
|
||||
* xref:testing/unit.adoc#mock-objects-servlet[Servlet API]
|
||||
* xref:testing/unit.adoc#mock-objects-web-reactive[Spring Web Reactive]
|
||||
|
||||
|
||||
[[mock-objects-env]]
|
||||
@@ -36,8 +36,8 @@ Spring includes a number of packages dedicated to mocking:
|
||||
|
||||
The `org.springframework.mock.env` package contains mock implementations of the
|
||||
`Environment` and `PropertySource` abstractions (see
|
||||
<<core.adoc#beans-definition-profiles, Bean Definition Profiles>>
|
||||
and <<core.adoc#beans-property-source-abstraction, `PropertySource` Abstraction>>).
|
||||
xref:core/beans/environment.adoc#beans-definition-profiles[Bean Definition Profiles]
|
||||
and xref:core/beans/environment.adoc#beans-property-source-abstraction[`PropertySource` Abstraction]).
|
||||
`MockEnvironment` and `MockPropertySource` are useful for developing
|
||||
out-of-container tests for code that depends on environment-specific properties.
|
||||
|
||||
@@ -69,7 +69,7 @@ TIP: Since Spring Framework 6.0, the mock objects in `org.springframework.mock.w
|
||||
based on the Servlet 6.0 API.
|
||||
|
||||
The Spring MVC Test framework builds on the mock Servlet API objects to provide an
|
||||
integration testing framework for Spring MVC. See <<spring-mvc-test-framework>>.
|
||||
integration testing framework for Spring MVC. See xref:testing/spring-mvc-test-framework.adoc[MockMvc].
|
||||
|
||||
|
||||
[[mock-objects-web-reactive]]
|
||||
@@ -90,7 +90,7 @@ write completion handle (that is, `Mono<Void>`), it by default uses a `Flux` wit
|
||||
`cache().then()`, which buffers the data and makes it available for assertions in tests.
|
||||
Applications can set a custom write function (for example, to test an infinite stream).
|
||||
|
||||
The <<webtestclient>> builds on the mock request and response to provide support for
|
||||
The xref:testing/webtestclient.adoc[WebTestClient] builds on the mock request and response to provide support for
|
||||
testing WebFlux applications without an HTTP server. The client can also be used for
|
||||
end-to-end tests with a running server.
|
||||
|
||||
@@ -102,8 +102,8 @@ end-to-end tests with a running server.
|
||||
Spring includes a number of classes that can help with unit testing. They fall into two
|
||||
categories:
|
||||
|
||||
* <<unit-testing-utilities>>
|
||||
* <<unit-testing-spring-mvc>>
|
||||
* xref:testing/unit.adoc#unit-testing-utilities[General Testing Utilities]
|
||||
* xref:testing/unit.adoc#unit-testing-spring-mvc[Spring MVC Testing Utilities]
|
||||
|
||||
|
||||
[[unit-testing-utilities]]
|
||||
@@ -162,7 +162,7 @@ that deal with Spring MVC `ModelAndView` objects.
|
||||
.Unit testing Spring MVC Controllers
|
||||
TIP: To unit test your Spring MVC `Controller` classes as POJOs, use `ModelAndViewAssert`
|
||||
combined with `MockHttpServletRequest`, `MockHttpSession`, and so on from Spring's
|
||||
<<mock-objects-servlet, Servlet API mocks>>. For thorough integration testing of your
|
||||
xref:testing/unit.adoc#mock-objects-servlet[Servlet API mocks]. For thorough integration testing of your
|
||||
Spring MVC and REST `Controller` classes in conjunction with your `WebApplicationContext`
|
||||
configuration for Spring MVC, use the
|
||||
<<spring-mvc-test-framework, Spring MVC Test Framework>> instead.
|
||||
xref:testing/spring-mvc-test-framework.adoc[Spring MVC Test Framework] instead.
|
||||
|
||||
Reference in New Issue
Block a user