Unit Testing for policy in APIGEE

Is it possible to perform unit testing of the default policy that is provide in APIGEE like "Extract Variables" , "Assign Message" ?

For Example:

  1. I am exacting some header using extract message and using that header i am routing to different target endpoint.
  2. I an using Assign Message policy to assign value in the payload or in header.

Now to test this two we need to run the trace to check value is being assign or its getting extracted or not.

Is their any way/script or something using test framework or npm module or nay other means which will automate the process??

@Ozan Seymen

@Diego Zuluaga

@Saul Zukauskas

@Dallen

Please suggest.

0 3 778
3 REPLIES 3

sidd-harth
Participant V

Hi @Ankit Dwivedi, take a look at apickli which can be used for integration testing.

Unit testing is mostly done for custom code like javascript, java, python, node.js within a proxy.

Siddharth Barahalikar Hey thanks for the reply, ya i know about apickli.

I just want to understand that can we do unit testing for policy present in APIGEE like Extract Variable, Assign Messge, KVM and all other

No Ankit, there is no such way. It's a configuration file so it should not be required to unit test it. Integration test is what, is required to test API's.