Sunday, May 1, 2016

How to use Ready! API to test APIs published in WSO2 API Manager

In this post I'm going to explain on how we can use the Ready! API(SmartBear Software) to test API's that are published in the WSO2 API Manager.

WSO2 API Manager


WSO2 API Manager is a 100% opensource solution for designing and publishing APIs. It also has the capability to create and manage a developer community. The core of the WSO2 API Manager is created using the WSO2 Enterprise Service Bus, Identity Server and Governance Registry components.

Ready! API


Ready! API is a product that is developed by SmartBear software which includes a platform of tools such as SoapUI NG Pro, LoadUI NG Pro, Secure Pro and ServiceV Pro that can be used to effectivly test API functinality. A more detailed description about these products can be found using their product page.


This post focus more on the Ready API Plugin usage and not WSO2 API Manager product functionalities. If you are new to WSO2 API Manager, I suggest you to go through our product page and documentation to get an idea about what WSO2 API Manager is and how to use it.


Ready! API has an extension point where people can create a plugin and alter the behavior of the product. WSO2 Team has created a plugin(named WSO2 API Manager Plugin)  for Ready API which helps the users to Integrate and Test their APIs that are visible in the WSO2 API Store. This blog post focuses on describing the features and advantages of the plugin.


WSO2 API Manager Plugin


Installation


The WSO2 API Manager Plugin is published in the Ready API Plugin repository. Hence installing the plugin can be done using following a simple set of steps. 

  1. Navigate to the Plugin Manager.
  2. Click on  "Browse Plugin Repository".
  3. Select the "WSO2 API Manager Integration" Plugin and click Install.
The following screenshot shows the above mentioned steps.




Usage

Once the plugin is installed, there are multiple ways to get the advantage of the plugin.

1. Create a project by importing a new API.
2. Add a new API to an already existing project.



When using both of the above mentioned options, you would see a prompt to enter the API Store connectivity details. What we need to do is to fill in the details and press the "OK" button. Note that the tenant domain field is not required if you are connecting to the super tenant store as the plugin will connect to the super tenant store if the field is not specified. 



After the above step, the plugin will connect to the API Store(give by the user) and list out all the APIs in its API list prompt.



The user only has to select the API(can select multiple APIs) and whether to create a test suit and a load test for the API. The plugin will connect to the API Manager instance using the REST APIs of the API Publisher and Store and will create a project by reading the swagger definition of the API(or APIs). The final outcome would be something similar to the following.


As you would notice, the plugin reads the Swagger definition and create a project with the sample requests. The plugin also creates an OAuth2 authorization profile with the name "wso2-api-manager-default" so that the end users would only need to give the OAuth2 token that they generated from the API Manager Store.

Once the API import is complete, the usage of the plugin is really simple. The user only needs to give the OAuth2 token to the "Access Token" field and fill in the necessary request parameters before invoking the sample request.

The response would look like what is stated in the image below.


As shown in the above steps, you could import any number of APIs from the API Store and test them using the Ready! API. Similar to the project created in SoapUI NG Pro, there would be projects created on LoadUI if the user has selected that option when importing the APIs.

Summary


The WSO2 API Manager plugin in the SmartBear plugin repository was developed to have a seamless experience when testing the APIs published in the WSO2 API Manager using Ready! API Platform. In summary the current plugin supports the listing of APIs in the given Store, creating sample requests for the selected APIs by reading their Swagger definitions and create test suits and load tests if that option was selected and many more features.

For more information about the plugin usage, please refer to this article and the Github project for the plugin.

What Ready! API integration brings to the WSO2 API Manager Platform

WSO2 API Manager is a complete free and opensource solution that has a rich set of features for API Creation, Publication and the complete API Lifecycle management with features to secure the API invocation. All these features come from the WSO2 platform and from the core features used in the products such as WSO2 Enterprise Service Bus, WSO2 Identity Server and WSO2 Governance Registry. In addition to that, the API Management platform utilizes the power of the WSO2 Data Analytics server for the API statistics analytics.

The above features of API Manager focuses more towards the development and run time aspects of the complete API development lifecycle. Apart from the above main states of a API development lifecycle, the other most important state is the Testing state. 

From this post, I will talk about the WSO2 API Manager and its integration with the Ready! API(by SmartBear) and what capabilities it brings to the WSO2 API Manager platform.

I'm assuming that everyone who reads this post would have some level of understanding about WSO2 API Manager and how it operates. I'm not going to explain the basics of WSO2 API Manager from this post. For more information about the API Manager product, please visit the product home page.

Ready! API

Ready! API is a platform of API testing tools by SmartBear which combines the power of SoapUI NG Pro, LoadUI NG Pro, Secure, ServiceV, and API Monitoring in AlertSite into a single bundle to give its users the power of functional testing, performance testing to post-deployment monitoring. For more information about Ready! API, please visit the Ready! API product overview page.

Ready! API Integration

Lets look at what Ready! API brings to the WSO2 Platform.

API testing is one of the key aspects of the API Development lifecycle. Any API Management solution would have integrated tools for API testing but most would lack the ability to conduct a complete API testing that a commercial tool would give. Most of the embedded tools would only have the capability of doing basic testing to get an idea about the request/response as well as to try out the different resources exposed from the API.

With the above points in play, it is important that the commercial API testing tools in the market could integrate with your solution to give the users the ability to carryout testing at will. We have done the same by making our API Management solution integrate with Ready! API, to give the ultimate API testing experience.


WSO2 Ready API Plugin

We have developed a plugin for the Ready! API to integrate with WSO2 API Manager and discover the APIs published in the Store. The plugin helps its users to select the APIs that needs to be imported using its inbuilt API Store browser and does all the work from creating the project, creating the sample requests to creating the load tests in LoadUI.  The plugin has been deployed to the SmartBear plugin repository so that Ready! API users would have the best user experience when using the WSO2 Ready API Plugin. For more information, please visit the SmartBear plugin repository and the github project of the WSO2 Ready API Plugin.

Conclusion

The development of the WSO2 Ready API Plugin has helped the WSO2 API Management platform to move to the next level by being able to integrate with a commercial API testing platform. The advantages of the Ready! API platform, including its core components of SoapUI NG Pro, LoadUI NG Pro, Secure, ServiceV, and API Monitoring in AlertSite have strengthened the API development lifecycle of the WSO2 API Management Platform.