java.lang.Object
org.springframework.cloud.function.serverless.web.ProxyMvc

public class ProxyMvc extends Object
Represents the main entry point into interaction with web application over light-weight proxy. After creating an instance via INSTANCE(Class...) operation which will initialize the provided component classes of your web application (effectively starting your web application less web server), you use service(HttpServletRequest, HttpServletResponse) operation to send request and receive a response.
Author:
Oleg Zhurakousky
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.web.context.ConfigurableWebApplicationContext
     
    jakarta.servlet.ServletContext
     
    static ProxyMvc
    INSTANCE(Class<?>... componentClasses)
     
    static ProxyMvc
    INSTANCE(org.springframework.web.context.ConfigurableWebApplicationContext applpicationContext)
     
    void
    service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
    Perform a request and return a type that allows chaining further actions, such as asserting expectations, on the result.
    void
    service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, CountDownLatch latch)
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getApplicationContext

      public org.springframework.web.context.ConfigurableWebApplicationContext getApplicationContext()
    • getServletContext

      public jakarta.servlet.ServletContext getServletContext()
    • INSTANCE

      public static ProxyMvc INSTANCE(org.springframework.web.context.ConfigurableWebApplicationContext applpicationContext)
    • INSTANCE

      public static ProxyMvc INSTANCE(Class<?>... componentClasses)
    • stop

      public void stop()
    • service

      public void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws Exception
      Perform a request and return a type that allows chaining further actions, such as asserting expectations, on the result.
      Parameters:
      requestBuilder - used to prepare the request to execute; see static factory methods in org.springframework.test.web.servlet.request.MockMvcRequestBuilders
      Throws:
      Exception
      See Also:
      • org.springframework.test.web.servlet.request.MockMvcRequestBuilders
      • org.springframework.test.web.servlet.result.MockMvcResultMatchers
    • service

      public void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, CountDownLatch latch) throws Exception
      Throws:
      Exception