Add an `DispatcherServletPath` interface which provides a much more
consistent way to discover the path of the main dispatcher servet.
Prior to this commit, auto-configurations would often make use of the
`ServerProperties` class to discover the dispatcher servlet path. This
mechanism isn't very explicit and also makes it hard for us to relocate
that property in Spring Boot 2.1.
This commit also reverts most of fddc9e9c7e since it is now clear that
the supporting multiple dispatcher servlet paths will be much more
involved that we originally anticipated.
Closes gh-13834
This commit updates WebTestClientAutoConfiguration to only create a
WebTestClient when running a WebFlux-based application as mocking the
context only works with that mode at the moment.
Closes gh-12318
This commit updates WebTestClientAutoConfiguration to only create a
WebTestClient when running a WebFlux-based application as mocking the
context only works with that mode at the moment.
Closes gh-12318
By default, AbstractTestExecutionListeners have an order of lowest
precedence. This means that it is impossible to write a listener with
lower precedence that any listener that's using the default order.
This commit updates Boot's 6 AbstractTestExecutionListeners to order
them explicitly. MockitoTestExecutionListener performs injection of
Mockito mocks and spies into the test instance. It now has an order of
2050 giving it slightly lower precedence than the dependency injection
test execution listener (2000).
The remaining 5 listeners have all been ordered with lowest precedence
- 100. This leaves them near their current lowest precedence position
while creating some room for any listeners that require lower
precedence.
Closes gh-11796