Class ServerlessMVC
java.lang.Object
org.springframework.cloud.function.serverless.web.ServerlessMVC
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic StringName of the property to specify application context initialization timeout. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.context.ConfigurableWebApplicationContextjakarta.servlet.ServletContextstatic ServerlessMVCstatic ServerlessMVCINSTANCE(org.springframework.boot.web.server.servlet.context.ServletWebServerApplicationContext applicationContext) voidservice(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.voidservice(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, CountDownLatch latch) voidstop()boolean
-
Field Details
-
INIT_TIMEOUT
Name of the property to specify application context initialization timeout. Default is 20 sec.
-
-
Method Details
-
INSTANCE
-
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 ininvalid reference
org.springframework.test.web.servlet.request.MockMvcRequestBuilders- Throws:
Exception- See Also:
-
service
public void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, CountDownLatch latch) throws Exception - Throws:
Exception
-
waitForContext
public boolean waitForContext()
-