Exclude null requestURI in MHSR.getRequestURL()

This commit undoes the changes made in ec5d81e78e and ensures that the
getRequestURL() method in MockHttpServletRequest does not include the
String "null" for a null requestURI by first checking if the requestURI
contains text before including it in the composed URL.

Issue: SPR-10643
This commit is contained in:
Sam Brannen
2013-09-11 23:08:05 +02:00
parent 45eab23e15
commit ee5d6c8f83
2 changed files with 16 additions and 5 deletions

View File

@@ -211,6 +211,13 @@ public class MockHttpServletRequestTests {
assertEquals("http://localhost", requestURL.toString());
}
@Test
public void getRequestURLWithNullRequestUri() {
request.setRequestURI(null);
StringBuffer requestURL = request.getRequestURL();
assertEquals("http://localhost", requestURL.toString());
}
@Test
public void getRequestURLWithDefaultsAndHttps() {
request.setScheme("https");