Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automation test on AWS API Gateway

Tags:

I want to test aws api gateway for each resource automatically. Currently I do it manually (choose API, choose resource, click test, insert data on request body). 1. Can I do it automatically? So when I have deployed, I able to know whether my api and resource work properly. 2. Inside the resource, I use lambda function that is connected to dynamo db. For example I create POST operation which is inserting data to dynamo db. Is it possible to check the data whether It is inserted successfully or not? Could anyone assist me on this? thanks

like image 807
putra Avatar asked Dec 07 '16 00:12

putra


2 Answers

  1. I think your best shot is to use Postman to test your API.

See: Use Postman to Test an API

  1. Can't you test it calling a GET after doing your resource POST? It could be done using Postman too.

Good luck!

like image 73
jfneis Avatar answered Sep 25 '22 16:09

jfneis


If you're hoping to use the same test feature that the console provides, there is an API for it, which is in the CLI and SDKs: http://docs.aws.amazon.com/cli/latest/reference/apigateway/test-invoke-method.html

If you just want to be able to test the deployed API, I'd recommend having a deployment workflow using the Stages as environments (like dev, gamma, prod). You can take one deployment (one snapshot of the API) and first deploy it to the dev stage. Then you can update the other stages with that same deployment. In this case, you could use any HTTP client/tool you like to test the actual deployed API in a test framework like JUnit.

like image 26
jackko Avatar answered Sep 23 '22 16:09

jackko