A service factory designed to improve the workflow of automations by mocking 3rd party services (eg. Appboy, Paypal) using Python 2.7, Serverless Framework, AWS Lambda and DynamoDB.
By modifying part of the request body sent to 3rd party service, to obtain the result you expect in order to effectly test your backend services. (Mostly edge cases or rare occuring cases)
To Test Error Handling on Payouts "PENDING" State of Paypal Batch Payouts Endpoint
Mock reqeust body:
{
"sender_batch_header": {
"sender_batch_id": "PENDING",
"email_subject": "You have a payout!"
},
"items": []
}
Mock reponse data:
{
"batch_header": {
"sender_batch_header": {
"sender_batch_id": "2014021801",
"email_subject": "You have a payout!"
},
"payout_batch_id": "12345678",
"batch_status": "PENDING"
}
}
npm install -g serverless
- Clone the repository
- Navigate to one of the services
- Deploy with
serverlss deploy --aws-profile <profile_name> (default is "default")
- You should see your API endpoints at the end of the deployment
Go into the directory of a specific mock service
serverless logs -f <function_name> -t --aws-profile <profile_name> --stage-<stage_name>