Empty path mapping behaves consistently

An empty path mapping in an @RequestMapping now consistently matches to
empty paths regardless of whether there are both type and method level,
annotations, or method-level only.

Closes gh-22543
This commit is contained in:
Rossen Stoyanchev
2019-04-09 15:03:24 -04:00
parent f839c1f9cd
commit d1f888a7a9
17 changed files with 96 additions and 41 deletions

View File

@@ -63,6 +63,7 @@ public final class MockMvcWebConnection implements WebConnection {
private final MockMvc mockMvc;
@Nullable
private final String contextPath;
private WebClient webClient;
@@ -91,7 +92,7 @@ public final class MockMvcWebConnection implements WebConnection {
* @param webClient the {@link WebClient} to use (never {@code null})
* @param contextPath the contextPath to use
*/
public MockMvcWebConnection(MockMvc mockMvc, WebClient webClient, String contextPath) {
public MockMvcWebConnection(MockMvc mockMvc, WebClient webClient, @Nullable String contextPath) {
Assert.notNull(mockMvc, "MockMvc must not be null");
Assert.notNull(webClient, "WebClient must not be null");
validateContextPath(contextPath);