lundi 15 janvier 2018

Build a test that consumes a Spring based REST API URL running on localhost for testing

I have build a REST API Based SMS gateway on Spring boot, along with an extensive testing suite comprising of unit and integration tests for testing the business logic and various layers of the API's architecture. I am now required to create a test which consumes the API call that runs from my localhost under various conditions. My queries are as follows:

1) Do I need to separately run the Spring Boot application on localhost before I can run the tests that directly consume the API from localhost?

2) I need to integrate my tests with Travis for Continuous integration. Is it possible to build an integration test which, on being run, starts the Spring application on localhost and directly calls the API URL from localhost for testing its response when different parameters are passed to the URL?

Aucun commentaire:

Enregistrer un commentaire