HtmlUnitRequestBuilder corrupts the parent RequestBuilder. For example:
String pathInfo ="/foo/bar";
MockMvc mockMvc =MockMvcBuilders.standaloneSetup(newHelloController())
.defaultRequest(get("/"))
.build();
// passes
assertThat(mockMvc.perform(get(pathInfo)).andReturn().getRequest().getPathInfo(), equalTo(pathInfo));
// corrupts the pathInfo of the parent builder
mockMvc.perform(requestBuilder);
// fails because the parent builder's path info is now set to "/"
assertThat(mockMvc.perform(get(pathInfo)).andReturn().getRequest().getPathInfo(), equalTo(pathInfo));
Rob Winch opened SPR-14584 and commented
HtmlUnitRequestBuilder
corrupts the parentRequestBuilder
. For example:Affects: 4.3.2, 5.0 M1
Referenced from: commits 43faabd, 966baea
The text was updated successfully, but these errors were encountered: