Class WireMockHttpServletRequestAdapter

java.lang.Object
com.github.tomakehurst.wiremock.jetty.WireMockHttpServletRequestAdapter
All Implemented Interfaces:
com.github.tomakehurst.wiremock.http.Request

public class WireMockHttpServletRequestAdapter extends Object implements com.github.tomakehurst.wiremock.http.Request
  • Field Details

  • Constructor Details

    • WireMockHttpServletRequestAdapter

      public WireMockHttpServletRequestAdapter(jakarta.servlet.http.HttpServletRequest request, String urlPrefixToRemove, boolean browserProxyingEnabled)
  • Method Details

    • getUrl

      public @NonNull String getUrl()
      Specified by:
      getUrl in interface com.github.tomakehurst.wiremock.http.Request
    • getPathAndQueryWithoutPrefix

      public @NonNull org.wiremock.url.PathAndQuery getPathAndQueryWithoutPrefix()
      Specified by:
      getPathAndQueryWithoutPrefix in interface com.github.tomakehurst.wiremock.http.Request
    • getAbsoluteUrl

      public @NonNull String getAbsoluteUrl()
      Specified by:
      getAbsoluteUrl in interface com.github.tomakehurst.wiremock.http.Request
    • getTypedAbsoluteUrl

      public @NonNull org.wiremock.url.AbsoluteUrl getTypedAbsoluteUrl()
      Specified by:
      getTypedAbsoluteUrl in interface com.github.tomakehurst.wiremock.http.Request
    • getMethod

      public com.github.tomakehurst.wiremock.http.RequestMethod getMethod()
      Specified by:
      getMethod in interface com.github.tomakehurst.wiremock.http.Request
    • getScheme

      public String getScheme()
      Specified by:
      getScheme in interface com.github.tomakehurst.wiremock.http.Request
    • getHost

      public String getHost()
      Specified by:
      getHost in interface com.github.tomakehurst.wiremock.http.Request
    • getPort

      public int getPort()
      Specified by:
      getPort in interface com.github.tomakehurst.wiremock.http.Request
    • getClientIp

      public String getClientIp()
      Specified by:
      getClientIp in interface com.github.tomakehurst.wiremock.http.Request
    • getBody

      public byte[] getBody()
      Specified by:
      getBody in interface com.github.tomakehurst.wiremock.http.Request
    • getBodyAsString

      public String getBodyAsString()
      Specified by:
      getBodyAsString in interface com.github.tomakehurst.wiremock.http.Request
    • getBodyAsBase64

      public String getBodyAsBase64()
      Specified by:
      getBodyAsBase64 in interface com.github.tomakehurst.wiremock.http.Request
    • getHeader

      public String getHeader(String key)
      Specified by:
      getHeader in interface com.github.tomakehurst.wiremock.http.Request
    • header

      public com.github.tomakehurst.wiremock.http.HttpHeader header(String key)
      Specified by:
      header in interface com.github.tomakehurst.wiremock.http.Request
    • contentTypeHeader

      public com.github.tomakehurst.wiremock.http.ContentTypeHeader contentTypeHeader()
      Specified by:
      contentTypeHeader in interface com.github.tomakehurst.wiremock.http.Request
    • containsHeader

      public boolean containsHeader(String key)
      Specified by:
      containsHeader in interface com.github.tomakehurst.wiremock.http.Request
    • getHeaders

      public com.github.tomakehurst.wiremock.http.HttpHeaders getHeaders()
      Specified by:
      getHeaders in interface com.github.tomakehurst.wiremock.http.Request
    • getAllHeaderKeys

      public Set<String> getAllHeaderKeys()
      Specified by:
      getAllHeaderKeys in interface com.github.tomakehurst.wiremock.http.Request
    • getCookies

      public Map<String,com.github.tomakehurst.wiremock.http.Cookie> getCookies()
      Specified by:
      getCookies in interface com.github.tomakehurst.wiremock.http.Request
    • formParameter

      public com.github.tomakehurst.wiremock.http.FormParameter formParameter(String key)
      Specified by:
      formParameter in interface com.github.tomakehurst.wiremock.http.Request
    • formParameters

      public Map<String,com.github.tomakehurst.wiremock.http.FormParameter> formParameters()
      Specified by:
      formParameters in interface com.github.tomakehurst.wiremock.http.Request
    • isBrowserProxyRequest

      public boolean isBrowserProxyRequest()
      Specified by:
      isBrowserProxyRequest in interface com.github.tomakehurst.wiremock.http.Request
    • getParts

      public Collection<com.github.tomakehurst.wiremock.http.Request.Part> getParts()
      Specified by:
      getParts in interface com.github.tomakehurst.wiremock.http.Request
    • isMultipart

      public boolean isMultipart()
      Specified by:
      isMultipart in interface com.github.tomakehurst.wiremock.http.Request
    • getPart

      public com.github.tomakehurst.wiremock.http.Request.Part getPart(String name)
      Specified by:
      getPart in interface com.github.tomakehurst.wiremock.http.Request
    • getOriginalRequest

      public Optional<com.github.tomakehurst.wiremock.http.Request> getOriginalRequest()
      Specified by:
      getOriginalRequest in interface com.github.tomakehurst.wiremock.http.Request
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProtocol

      public String getProtocol()
      Specified by:
      getProtocol in interface com.github.tomakehurst.wiremock.http.Request