List of usage examples for org.springframework.mock.web MockHttpServletRequest setLocalName
public void setLocalName(String localName)
From source file:com.amashchenko.struts2.pdfstream.PdfStreamResultTest.java
@Test public void testFindBaseUrl() throws Exception { Assert.assertNotNull(pdfStreamResult); MockHttpServletRequest request = new MockHttpServletRequest(); request.setLocalName("localhost"); request.setRequestURI("/contextPath/requestURI"); request.setQueryString("queryString"); request.setContextPath("/contextPath"); final String baseUrl = pdfStreamResult.findBaseUrl(request); Assert.assertEquals("http://localhost/contextPath/", baseUrl); }