Reputation: 2882
I've looked through the documentation and don't see anything related to unit testing of APIs created with Apigee. With our current homegrown APIs we're writing today, we can inject and mock dependencies for unit testing and integration testing. Is this something that's possible with Apigee at all?
Upvotes: 1
Views: 2375
Reputation: 1
For Unit testing You can create Mock API proxy on APIGEE which stores dummy responses. Use this mock API as your target and using postman you can test request/response.
Upvotes: 0
Reputation: 19
Apigee api can be tested using postman and you should enable trace in debug -->start trace and once you fire the api you can see the logs/values/policy execution in detail in trace and this way we can do unit testing.
Upvotes: -1
Reputation: 86
Apigee policies are more properly understood to be configuration items and as such would not be unit testable - rather they are only testable as an integration target which are readily automated with our Maven plugin.
Java callouts, javascript callouts, Node servers, python callouts and the like are testable in an offline mode using the same tools you use today. Your harnesses of course will have to take into account the context of execution - which is not trivial. Apigee today does not provide any tooling to provide that context. Of course if you already unit testing homegrown APIs you probably have experience with something like RhinoUnit.
To summarize - my point of view is that policies are configuration and as such are not unit test targets. Some resources (which are referenced in a call out policy for instance) are code and are appropriate targets for unit test.
Upvotes: 2
Reputation: 606
While Apigee doesn't support a unit testing framework directly in our products, there are plenty of external options out there you can use for mass testing. For example, there's Apache JMeter and frisbyjs.
Upvotes: 0