Test
Jump to navigation
Jump to search
Test
initialSetup lambda
set one time after deploy service to AWS
- go to AWS server => Lambda
- choose InitialSetup lambda
- Test => Test event => Event JSON
{
}
see output in CloudWatch
Test: API Handler
- go to AWS server => Lambda
- choose your lambda ex: CreateProduct_HdrApi
- Test => Test event => Event JSON
{
"type": "Clothes",
"name": "Dream"
}
- see output in CloudWatch ex: https://us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:log-groups
- see record in AWS server => DynamoDB => your table => ex: ServicePraewTestProductRecord ex: https://us-east-2.console.aws.amazon.com/dynamodbv2/home?region=us-east-2#item-explorer?
Test: Sqs Handler
AWS server => SNS => choose your Sns In ex: InProcessProduct
Test SQS | SNS Hdr : https://us-east-2.console.aws.amazon.com/sns/v3/home?region=us-east-2#/topic/arn:aws:sns:us-east-2:46856809[…]ServicePraewTestInProcessProduct
- click Publish message
- in Message body
{
"filterType":"sellOffer",
"elements":[
{
"type":"logical",
"logicalTag":"maxPrice",
"comparison":"greaterThan",
"value":"60",
"orderQuantity":1,
"deliverToLocationIds":[
"ChiangMai"
],
"paymentMethodIds":[
"SCB"
],
"deliveryMethodIds":[
"Kerry"
],
"excludeEmpty":true
}
]
}
- in Message attributes
example request:
awsRequestId : {
DataType: 'String',
StringValue: '3a2ed81d-208d-5e85-95b5-83b27360510f'
},
x-correlation-id : {
DataType: 'String',
StringValue: 'c8793a88-d995-442c-a625-8b7e7b95fae8'
},
call-chain-length : { DataType: 'String', StringValue: '1' },
debug-log-enabled : { DataType: 'String', StringValue: 'false' },
callingFlow : {
DataType: 'String',
StringValue: 'SearchResultsTestComplexFilterComplete'
},
serviceName : { DataType: 'String', StringValue: 'SearchResults' }
- click Publish message
- see output in CloudWatch => ProcessProduct_HdrSqs ex: https://us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:log-groups