People tell me A and B, They tell me how I have to see, Things that I have seen already clear, So they push me then from side to side (I Want Out - Helloween)Develop an application that uses RESTful web API may imply developing server and client side. Writing integration tests for server side can be as easy as using Arquillian to start up server and REST-assured to test that the services works as expected. The problem is how to test the client side. In this post we are going to see how to test the client side apart from using mocks.
- We use ClientDriverRule @Rule annotation to add the client-driver to a test.
- And then using methods provided by RestClientDriver class, expectations are recorded.
- See how we are setting the base URL using driver.getBaseUrl()