samedi 1 septembre 2018

rest assured java.net.SocketException

I am executing a simple post test in rest-assured,
While exeuting post() method I am getting "java.net.SocketException: Operation timed out"

@Test
public void validateGetProductInfo_Prod() throws IOException {

String jsonBody = new String(Files.readAllBytes(Paths.get("src/test/resources/product.json")));

Headers basicHeaders = new Headers(asList(
        new Header("X-ApplicationAuthorizationToken", "AAABB"),
        new Header("Authorization", "Basic ABC"),
        new Header("Content-Type", "application/json")));

String produPath = "http://api.abcd.com/product/v1/product/info";

given().headers(basicHeaders)
        .body(jsonBody)
        .when()
        .post(produPath)
        .then().using().defaultParser(Parser.JSON)
        .statusCode(200);
}    

I had validated that there is no error till the when is executed,
On executign the post() method facing the exception?

Aucun commentaire:

Enregistrer un commentaire