Test

From Izara Wiki
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"
}

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' }