Deprecate and set trailingSlash option to false
Closes gh-28552
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -358,7 +358,10 @@ public interface MockMvcWebTestClient {
|
||||
* Whether to match trailing slashes.
|
||||
* <p>This is delegated to
|
||||
* {@link StandaloneMockMvcBuilder#setUseTrailingSlashPatternMatch(boolean)}.
|
||||
* @deprecated as of 6.0, see
|
||||
* {@link PathPatternParser#setMatchOptionalTrailingSeparator(boolean)}
|
||||
*/
|
||||
@Deprecated
|
||||
ControllerSpec useTrailingSlashPatternMatch(boolean useTrailingSlashPatternMatch);
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -152,6 +152,7 @@ class StandaloneMockMvcSpec extends AbstractMockMvcServerSpec<MockMvcWebTestClie
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public StandaloneMockMvcSpec useTrailingSlashPatternMatch(boolean useTrailingSlashPatternMatch) {
|
||||
this.mockMvcBuilder.setUseTrailingSlashPatternMatch(useTrailingSlashPatternMatch);
|
||||
|
||||
@@ -343,8 +343,10 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder<StandaloneM
|
||||
/**
|
||||
* Whether to match to URLs irrespective of the presence of a trailing slash.
|
||||
* If enabled a method mapped to "/users" also matches to "/users/".
|
||||
* <p>The default value is {@code true}.
|
||||
* @deprecated as of 6.0, see
|
||||
* {@link PathPatternParser#setMatchOptionalTrailingSeparator(boolean)}
|
||||
*/
|
||||
@Deprecated
|
||||
public StandaloneMockMvcBuilder setUseTrailingSlashPatternMatch(boolean useTrailingSlashPatternMatch) {
|
||||
this.useTrailingSlashPatternMatch = useTrailingSlashPatternMatch;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user