Preliminary Remark: This blog post targets Open Source developers and will basically cover technical details.
Automated Integration Testing for Java Web Services is an important pylon to ensure the stability of a web service and in particular its internal workflows. It is a very convenient way to ensure that the server is reacting just as expected in a set of pre-defined situations in terms of responses to specific requests. An easy way of defining integration tests is to provide a certain set of fully-defined requests (POST, GET, …) and corresponding responses. However, if you also are maintaining a client framework or library dedicated to that service, you are in the sweet situation of being able to kill two birds with one stone:
End-To-End Client-Server Integration Testing.
This is the first of two blog posts on End-To-End Integration Testing. For now, I am focussing on the Maven project setup. The follow-up will provide some insights on the actual implementation of integration tests – the client side.
In the following I will try to provide a guide on how to incorporate an integration testing component into your existing Maven-3-managed web service. I will use the 52°North Sensor Event Service (SES, server component) and the 52°North OX-Framework (OXF, client library) as a hook for the following sections. Knowledge of the following topics is helpful for understanding the article:
We will cover all needed steps to enable integration testing in your web service project. In particular, details on preparing a temporary webapp, reserving network ports dynamically, bootstrapping a servlet container and the actual execution of the integration tests will be illustrated.