gt:         this.content = content.getBytes();
context: package com.dotcms.mock.request;
  
  import java.io.BufferedReader;
  import java.io.ByteArrayInputStream;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.UnsupportedEncodingException;
  import java.security.Principal;
  import java.util.Collection;
  import java.util.Collections;
  import java.util.Enumeration;
  import java.util.HashMap;
  import java.util.Locale;
  import java.util.Map;
  import javax.servlet.AsyncContext;
  import javax.servlet.DispatcherType;
  import javax.servlet.ReadListener;
  import javax.servlet.RequestDispatcher;
  import javax.servlet.ServletContext;
  import javax.servlet.ServletException;
  import javax.servlet.ServletInputStream;
  import javax.servlet.ServletRequest;
  import javax.servlet.ServletResponse;
  import javax.servlet.http.Cookie;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.http.HttpSession;
  import javax.servlet.http.HttpUpgradeHandler;
  import javax.servlet.http.Part;
  
  public class DotCMSMockRequest implements HttpServletRequest {
  
      private String uri;
      private StringBuffer requestURL;
      private String serverName;
      private String remoteAddr;
      private String remoteHost;
      private String queryString;
      private Map<String, String[]> paramMap = new HashMap<>();
      final private Map<String, String> headers = new HashMap<>();
      private String servletPath;
      final private Map<String, Object> attributes = new HashMap<>();
      protected byte[] content;
  
      @Override
      public String getRequestURI() {
          return uri;
      }
  
      @Override
      public StringBuffer getRequestURL() {
          return requestURL;
      }
  
      @Override
      public String getServerName() {
          return serverName;
      }
  
      @Override
      public int getServerPort() {
          return 0;
      }
  
      @Override
      public BufferedReader getReader() throws IOException {
          return new BufferedReader(new InputStreamReader(this.getInputStream()));
      }
  
      @Override
      public String getRemoteAddr() {
          return remoteAddr;
      }
  
      @Override
      public String getRemoteHost() {
          return remoteHost;
      }
  
      @Override
      public String getQueryString() {
          return queryString;
      }
  
      @Override
      public String getRemoteUser() {
          return null;
      }
  
      @Override
      public boolean isUserInRole(String s) {
          return false;
      }
  
      @Override
      public Principal getUserPrincipal() {
          return null;
      }
  
      @Override
      public String getRequestedSessionId() {
          return null;
      }
  
      @Override
      public Map<String, String[]> getParameterMap() {
          return paramMap;
      }
  
      @Override
      public String getProtocol() {
          return null;
      }
  
      @Override
      public String getScheme() {
          return null;
      }
  
      @Override
      public Enumeration<String> getParameterNames() {
          return Collections.enumeration(paramMap.keySet());
      }
  
      @Override
      public String[] getParameterValues(String s) {
          return new String[0];
      }
  
      @Override
      public String getParameter(final String name) {
          final String[] answer = paramMap.get(name);
          return answer!=null && answer.length > 0 ? answer[0] : null;
      }
  
      @Override
      public String getAuthType() {
          return null;
      }
  
      @Override
      public Cookie[] getCookies() {
          return new Cookie[0];
      }
  
      @Override
      public long getDateHeader(String s) {
          return 0;
      }
  
      @Override
      public String getHeader(final String name) {
          return headers.get(name);
      }
  
      @Override
      public Enumeration<String> getHeaders(String s) {
          return null;
      }
  
      @Override
      public Enumeration<String> getHeaderNames() {
          return null;
      }
  
      @Override
      public int getIntHeader(String s) {
          return 0;
      }
  
      @Override
      public String getMethod() {
          return null;
      }
  
      @Override
      public String getPathInfo() {
          return null;
      }
  
      @Override
      public String getPathTranslated() {
          return null;
      }
  
      @Override
      public String getContextPath() {
          return null;
      }
  
      @Override
      public String getServletPath() {
          return servletPath;
      }
  
      @Override
      public HttpSession getSession(boolean b) {
          return null;
      }
  
      @Override
      public HttpSession getSession() {
          return null;
      }
  
      @Override
      public String changeSessionId() {
          return null;
      }
  
      @Override
      public boolean isRequestedSessionIdValid() {
          return false;
      }
  
      @Override
      public boolean isRequestedSessionIdFromCookie() {
          return false;
      }
  
      @Override
      public boolean isRequestedSessionIdFromURL() {
          return false;
      }
  
      @Override
      public boolean isRequestedSessionIdFromUrl() {
          return false;
      }
  
      @Override
      public boolean authenticate(HttpServletResponse httpServletResponse)
              throws IOException, ServletException {
          return false;
      }
  
      @Override
      public void login(String s, String s1) throws ServletException {
  
      }
  
      @Override
      public void logout() throws ServletException {
  
      }
  
      @Override
      public Collection<Part> getParts() throws IOException, ServletException {
          return null;
      }
  
      @Override
      public Part getPart(String s) throws IOException, ServletException {
          return null;
      }
  
      @Override
      public <T extends HttpUpgradeHandler> T upgrade(Class<T> aClass)
              throws IOException, ServletException {
          return null;
      }
  
      @Override
      public Object getAttribute(String name) {
          return this.attributes.get(name);
      }
  
      @Override
      public Enumeration<String> getAttributeNames() {
          return null;
      }
  
      @Override
      public String getCharacterEncoding() {
          return null;
      }
  
      @Override
      public void setCharacterEncoding(String s) throws UnsupportedEncodingException {
  
      }
  
      @Override
      public int getContentLength() {
          return 0;
      }
  
      @Override
      public long getContentLengthLong() {
          return 0;
      }
  
      @Override
      public String getContentType() {
          return null;
      }
  
      public ServletInputStream getInputStream() throws IOException {
          return new ServletInputStream() {
              private final ByteArrayInputStream proxy;
  
              {
                  this.proxy = new ByteArrayInputStream(DotCMSMockRequest.this.content);
              }
  
              public int read() {
                  return this.proxy.read();
              }
  
              public int available() {
                  return this.proxy.available();
              }
  
              public synchronized void mark(int readlimit) {
                  this.proxy.mark(readlimit);
              }
  
              public boolean markSupported() {
                  return this.proxy.markSupported();
              }
  
              public int read(byte[] b, int off, int len) {
                  return this.proxy.read(b, off, len);
              }
  
              public void close() throws IOException {
                  this.proxy.close();
              }
  
              public int read(byte[] b) throws IOException {
                  return this.proxy.read(b);
              }
  
              public synchronized void reset() {
                  this.proxy.reset();
              }
  
              public long skip(long n) {
                  return this.proxy.skip(n);
              }
  
              public boolean isFinished() {
                  return false;
              }
  
              @Override
              public boolean isReady() {
                  return false;
              }
  
              @Override
              public void setReadListener(ReadListener readListener) {
                  //Not implemented
              }
          };
      }
  
      public void setAttribute(String name, Object value) {
          this.attributes.put(name, value);
      }
  
      @Override
      public void removeAttribute(String s) {
  
      }
  
      @Override
      public Locale getLocale() {
          return null;
      }
  
      @Override
      public Enumeration<Locale> getLocales() {
          return null;
      }
  
      @Override
      public boolean isSecure() {
          return false;
      }
  
      @Override
      public RequestDispatcher getRequestDispatcher(String s) {
          return null;
      }
  
      @Override
      public String getRealPath(String s) {
          return null;
      }
  
      @Override
      public int getRemotePort() {
          return 0;
      }
  
      @Override
      public String getLocalName() {
          return null;
      }
  
      @Override
      public String getLocalAddr() {
          return null;
      }
  
      @Override
      public int getLocalPort() {
          return 0;
      }
  
      @Override
      public ServletContext getServletContext() {
          return null;
      }
  
      @Override
      public AsyncContext startAsync() throws IllegalStateException {
          return null;
      }
  
      @Override
      public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
              throws IllegalStateException {
          return null;
      }
  
      @Override
      public boolean isAsyncStarted() {
          return false;
      }
  
      @Override
      public boolean isAsyncSupported() {
          return false;
      }
  
      @Override
      public AsyncContext getAsyncContext() {
          return null;
      }
  
      @Override
      public DispatcherType getDispatcherType() {
          return null;
      }
  
      public void addHeader(final String name, final String value) {
          this.headers.put(name, value);
      }
  
      public void setRequestURI(final String uri) {
          this.uri = uri;
      }
  
      public void setRequestURL(final StringBuffer requestURL) {
          this.requestURL = requestURL;
      }
  
      public void setServerName(final String serverName) {
          this.serverName = serverName;
      }
  
      public void setRemoteAddr(final String remoteAddr) {
          this.remoteAddr = remoteAddr;
      }
  
      public void setRemoteHost(final String remoteHost) {
          this.remoteHost = remoteHost;
      }
  
      public void setQueryString(final String queryString) {
          this.queryString = queryString;
      }
  
      public void setParameterMap(final Map<String, String[]> paramMap) {
          this.paramMap = paramMap;
      }
  
      public void setServletPath(String servletPath) {
          this.servletPath = servletPath;
      }
  
      public void setContent(byte[] content) {
          this.content = content;
      }
  
      public void setContent(String content) {
  