0

Recently I've made use of RestAssured for testing Rest API and it seems to be pretty useful. However I've a query regarding testing rest end-points. We don't deploy our services locally onto a server. We write the unit test and integration tests and test it and deploy it on a separate dev1 environment. What I want is to write an integration test that will post a request and test the rest-endpoint using restassured.Kindly advise. Thanks.

P.S. We don't have local server where we can deploy and hit the rest end-point.

Sandy
  • 459
  • 2
  • 6
  • 19

2 Answers2

0

Local or remote server doesn't matter I hope. Pls take a look at docs https://github.com/rest-assured/rest-assured/wiki/Usage

Ramu
  • 161
  • 7
-1

You can set the remote server URL globally for all tests using RestAssured.baseURI="<BaseURL>" or you can pass the full URL in RestAssured method itself like get("http://baseURL/service1")

Ramu
  • 161
  • 7
  • It is better to declare the URLs for the diffent tests inside the test classes in a string variable and use them in case of the different HTTP methods (get/post/put/delete). – Gergely A. Jan 16 '17 at 10:58