java.net.ConnectException: Connection refused: connect

Hi All, Getting the below error when trying to run the Rest Assured code to get the request FAILED: GetWeatherDetails java.net.ConnectException: Connection refused: connect   Below is the code being used. Please help in resolving this issue. public class NewTest { @BeforeTest public void setProxy() { System.setProperty(“http.proxyHost”, “oproxy.fg.xxx.com”); } @Test public void GetWeatherDetails() { //Specifies the base URI of the restfull web service RestAssured.baseURI = “http://services.groupkt.com/country/get/iso2code”; RequestSpecification httpRequest = RestAssured.given(); Response response = httpRequest.request(Method.GET, “/IN”); String responseBody = response.getBody().asString(); System.out.println(“Response Body is =>” + responseBody); } }

Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.