Many modern applications are based on a REST API base software architecture and it is important to apply software testing verification to this code. In his article “REST API Test Automation in Java with Open Source Tools”, Vladimir Belorusets provides a good overview on how to test Java REST API with open source tools.
The article starts with a description of the automation process required to test REST API:
1. Compose a REST call manually with the help of a REST client tool.
2. Model the endpoint response into an object class using any object-oriented programming language of your choice.
3. Generate the same REST call programmatically and serialize the response object into a file as the expected result.
4. Create a script that issues the REST API call and compares the response object with the expected object after deserialization.
Vladimir Belorusets then explores in the remaining of the article each step mentioned above and suggest a number of open source tools that might be used. Some code is also provided to help the reader better understand like the mapping of the JSON response in Java classes.
His conclusion is that “Manual testers can use REST clients that provide convenient GUI for hitting the end-points while test automation engineers with Java experience can develop comprehensive tests fast.”
Read the complete article on http://www.methodsandtools.com/archive/restapitesting.php