public class MockContext extends Object
A simple mock implementation of the Context interface. Default
values are stubbed out, and setters are provided so you can customize
the context before passing it to your function.
| Modifiers | Name | Description |
|---|---|---|
static String |
AWS_REQUEST_ID |
|
static String |
FUNCTION_NAME |
|
static String |
FUNCTION_VERSION |
|
static String |
INVOKED_FUNCTION_ARN |
|
static String |
LOG_GROUP_NAME |
|
static String |
LOG_STREAM_NAME |
|
static int |
SAMPLE_MEMORY_LIMIT |
|
static int |
SAMPLE_REMAINING_TIME |
| Type | Name and description |
|---|---|
String |
awsRequestId |
com.amazonaws.services.lambda.runtime.ClientContext |
clientContext |
String |
functionName |
String |
functionVersion |
com.amazonaws.services.lambda.runtime.CognitoIdentity |
identity |
String |
invokedFunctionArn |
String |
logGroupName |
String |
logStreamName |
com.amazonaws.services.lambda.runtime.LambdaLogger |
logger |
int |
memoryLimitInMB |
int |
remainingTimeInMillis |
| Type Params | Return Type | Name and description |
|---|---|---|
|
String |
getAwsRequestId() |
|
com.amazonaws.services.lambda.runtime.ClientContext |
getClientContext() |
|
String |
getFunctionName() |
|
String |
getFunctionVersion() |
|
com.amazonaws.services.lambda.runtime.CognitoIdentity |
getIdentity() |
|
String |
getInvokedFunctionArn() |
|
String |
getLogGroupName() |
|
String |
getLogStreamName() |
|
com.amazonaws.services.lambda.runtime.LambdaLogger |
getLogger() |
|
int |
getMemoryLimitInMB() |
|
int |
getRemainingTimeInMillis() |
|
void |
setAwsRequestId(String awsRequestId) |
|
void |
setClientContext(com.amazonaws.services.lambda.runtime.ClientContext clientContext) |
|
void |
setFunctionName(String functionName) |
|
void |
setFunctionVersion(String functionVersion) |
|
void |
setIdentity(com.amazonaws.services.lambda.runtime.CognitoIdentity identity) |
|
void |
setInvokedFunctionArn(String invokedFunctionArn) |
|
void |
setLogGroupName(String logGroupName) |
|
void |
setLogStreamName(String logStreamName) |
|
void |
setLogger(com.amazonaws.services.lambda.runtime.LambdaLogger logger) |
|
void |
setMemoryLimitInMB(int memoryLimitInMB) |
|
void |
setRemainingTimeInMillis(int remainingTimeInMillis) |