title: How to mock the HttpServletRequest?
body: <p>I have a function that looks for a query parameter and returns a boolean:</p>
  
  <pre><code>  public static Boolean getBooleanFromRequest(HttpServletRequest request, String key) {
          Boolean keyValue = false;
          if(request.getParameter(key) != null) {
              String value = request.getParameter(key);
              if(keyValue == null) {
                  keyValue = false;
              }
              else {
                  if(value.equalsIgnoreCase("true") || value.equalsIgnoreCase("1")) {
                      keyValue = true;
                  }
              }
          }
          return keyValue;
      }
  </code></pre>
  
  <p>I have both junit and easymock in my pom.xml, how do I go about mocking the HttpServletRequest ?</p>