public RequestContextFactory
Creates a class Params instance representing the request context; only used in testing.
When an Osiris application is deployed on AWS then the request context is filled in by API Gateway. In some cases the handler code uses the context, for example to get the name of the API Gateway stage. When the application is running in a local server the context information needed by the handler code must still be provided.
This interface provides a way for the user to plug-in something to generate valid context information when the code is running on a regular HTTP server.
There are two simple implementations provided
This is only needed in testing, but needs to be in the core module so it can be used in the core tests
and in the main HTTP server code in local-server.
class Params| Modifier and Type | Interface and Description |
|---|---|
static class |
RequestContextFactory.Companion |
| Modifier and Type | Field and Description |
|---|---|
static RequestContextFactory.Companion |
Companion |
| Modifier and Type | Method and Description |
|---|---|
Params |
createContext(HttpMethod httpMethod,
java.lang.String path,
Params headers,
Params queryParams,
Params pathParams,
java.lang.Object body) |
static RequestContextFactory.Companion Companion
Params createContext(HttpMethod httpMethod, java.lang.String path, Params headers, Params queryParams, Params pathParams, java.lang.Object body)