1   package com.atlassian.seraph.util;
2   
3   import com.mockobjects.servlet.MockHttpServletRequest;
4   import com.mockobjects.ReturnValue;
5   
6   /** For some reason the mockobjects wankers did not implement getRequestURL.
7    * Not a hint in the comments as to why... grr
8    */
9   public class LocalMockHttpServletRequest extends MockHttpServletRequest
10  {
11      private final ReturnValue myRequestURL = new ReturnValue("request url");
12      private int port;
13  
14      public int getServerPort()
15      {
16          return port;
17      }
18  
19      public void setupPort(int port)
20      {
21          this.port = port;
22      }
23  
24      public void setupGetRequestURL(String requestURL)
25      {
26          myRequestURL.setValue(requestURL);
27      }
28  
29      public StringBuffer getRequestURL()
30      {
31          return new StringBuffer((String) myRequestURL.getValue());
32      }
33  }