提交 7a7958f2 编写于 作者: J Juergen Hoeller

MockMvcResultMatchers.forwardedUrl argument declared as nullable

Issue: SPR-17623
上级 ca9c3471
...@@ -21,6 +21,7 @@ import javax.xml.xpath.XPathExpressionException; ...@@ -21,6 +21,7 @@ import javax.xml.xpath.XPathExpressionException;
import org.hamcrest.Matcher; import org.hamcrest.Matcher;
import org.springframework.lang.Nullable;
import org.springframework.test.web.servlet.ResultMatcher; import org.springframework.test.web.servlet.ResultMatcher;
import org.springframework.util.AntPathMatcher; import org.springframework.util.AntPathMatcher;
import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.UriComponentsBuilder;
...@@ -85,7 +86,7 @@ public abstract class MockMvcResultMatchers { ...@@ -85,7 +86,7 @@ public abstract class MockMvcResultMatchers {
* <p>This method accepts only exact matches. * <p>This method accepts only exact matches.
* @param expectedUrl the exact URL expected * @param expectedUrl the exact URL expected
*/ */
public static ResultMatcher forwardedUrl(String expectedUrl) { public static ResultMatcher forwardedUrl(@Nullable String expectedUrl) {
return result -> assertEquals("Forwarded URL", expectedUrl, result.getResponse().getForwardedUrl()); return result -> assertEquals("Forwarded URL", expectedUrl, result.getResponse().getForwardedUrl());
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册