Class ServerlessMVC

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

public final class ServerlessMVC 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
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
    Name of the property to specify application context initialization timeout.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.web.context.ConfigurableWebApplicationContext
     
    jakarta.servlet.ServletContext
     
    INSTANCE(Class<?>... componentClasses)
     
    INSTANCE(org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext applicationContext)
     
    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
     
    boolean
     

    Methods inherited from class Object

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

    • INIT_TIMEOUT

      public static String INIT_TIMEOUT
      Name of the property to specify application context initialization timeout. Default is 20 sec.
  • Method Details

    • INSTANCE

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

      public static ServerlessMVC INSTANCE(org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext applicationContext)
    • getApplicationContext

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

      public jakarta.servlet.ServletContext getServletContext()
    • 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
      invalid reference
      org.springframework.test.web.servlet.request.MockMvcRequestBuilders
      Throws:
      Exception
      See Also:
      • invalid reference
        org.springframework.test.web.servlet.request.MockMvcRequestBuilders
      • invalid reference
        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
    • waitForContext

      public boolean waitForContext()