{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Edge/API Management /
avatar image
4
Question by Ganesh · Mar 09, 2015 at 12:03 PM · 4.3k Views proxy

Unit Testing Api Proxies

How do i UNIT Test my proxies.what is the best approach...

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

3 Answers

  • Sort: 
avatar image
6
Best Answer

Answer by ozanseymen   · May 11, 2015 at 08:14 PM

With an Apigee implementation, when we talk about unit testing we are mostly referring to "unit testing" custom code like javascript, java, python, node.js - and it is whole different debate how useful they are if your integration testing is touching most/all of the code. They are extremely useful if custom code doesn't participate fully in API responses, e.g. loggly integration code in JavaScript or any other service callout that doesn't contribute to API responses.

However it is a must-have to do proper integration testing for your API - this would test how clients are integrating with the API and in turn how API is integrating with the backend components. In order to do that you would hit the northbound API interface with some input and assert the responses from the API (as in @dzuluaga's example above).

I'd argue that unit testing frameworks are too low level for doing such API integration testing. This is the whole reason why we are working on frameworks/tools like apickli (https://github.com/apickli/apickli).

Just for comparison, here is how @dzuluaga's example above can be written using apickli/gherkin:

Scenario: Check whether in cities
GIVEN I set User-Agent header to request
WHEN I GET /weathergrunt/apigee/forecastrss?w=2502265
THEN response body should contain Sunnyvale, Madrid
AND response code should be 200

Full gherkin language supported by apickli can be found here: https://github.com/apickli/apickli#gherkin-expressions

Comment
Add comment Show 1 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Oliver.Ogg · Jul 29, 2015 at 08:45 AM 2
Link

Slight typo in that apickli URL: https://github.com/apickli/apickli :)

avatar image
3

Answer by Saul Zukauskas · May 11, 2015 at 08:54 PM

Great discussion!

JMeter as great as it is for performance testing stores test scenarios in custom XML structure and this becomes an issue if you have more than one person writing tests and using code version control.

Cucumber is a nice little framework which is used by many teams for all sorts of testing.

As @Ozan Seymen mentioned above project we created based on Cucumber.js (JavaScript implementation of Cucumber framework) might be what you are looking for.

It supports both Gulp and Grunt task runners and can be fully automated as well.

Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by suresh prabhu · Jan 22 at 09:59 AM

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.

Comment
Add comment · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Fetch WSDL Error: Could not download resource. peer not authenticated. 6 Answers

Api proxy to Swagger code 5 Answers

Getting Error Creating Proxy from WSDL 2 Answers

deploy-bundle failed due to proxy 1 Answer

load balancing proxies 0 Answers

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2019 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Members
  • Badges