mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-29 02:39:04 +00:00
AbstractMockHttpServletRequestBuilder#buildRequest is not idempotent
See gh-35493 Signed-off-by: Réda Housni Alaoui <reda-alaoui@hey.com>
This commit is contained in:
committed by
rstoyanchev
parent
a19b51b7e0
commit
636523a2f5
+9
@@ -31,6 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
* Tests for {@link AbstractMockHttpServletRequestBuilder}
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @author Réda Housni Alaoui
|
||||
*/
|
||||
class AbstractMockHttpServletRequestBuilderTests {
|
||||
|
||||
@@ -97,6 +98,14 @@ class AbstractMockHttpServletRequestBuilderTests {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void pathInfoIsNotMutatedByBuildMethod() {
|
||||
TestRequestBuilder builder = new TestRequestBuilder(HttpMethod.GET).uri("/b");
|
||||
assertThat(buildRequest(builder).getPathInfo()).isEqualTo("/b");
|
||||
builder.uri("/a");
|
||||
assertThat(buildRequest(builder).getPathInfo()).isEqualTo("/a");
|
||||
}
|
||||
|
||||
private MockHttpServletRequest buildRequest(AbstractMockHttpServletRequestBuilder<?> builder) {
|
||||
return builder.buildRequest(this.servletContext);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user