I am using TestNG with RestAssured framework to test RestAPI's.
The moment the execution hits this line, httpRequest.request, it throws connection timeout error
Am I missing anything in that line? It didn't throw any syntax error.
import org.testng.annotations.BeforeMethod;
import static io.restassured.RestAssured.ntlm;
import static io.restassured.RestAssured.basic;
import org.testng.annotations.Test;
import io.restassured.RestAssured;
import io.restassured.http.Method;
import io.restassured.response.Response;
import io.restassured.specification.RequestSpecification;
public class RestApi_Incidents {
@BeforeMethod
public void beforeMethod() {
System.out.println("before method");
}
@Test
void GetIncidentAPI(){
try{
RestAssured.baseURI = "https://xxx/api/data/v8.2";
RestAssured.port = 80;
RestAssured.basePath = "/incident";
RestAssured.authentication = basic("userid", "pwd!");
//RestAssured.authentication = ntlm("uid", "pws!", null, "uat");
RequestSpecification httpRequest = RestAssured.given();
Response response =httpRequest.get();
}
catch (Exception ex){
System.out.println(ex.toString());
}
}
}