Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Printing response using rest assured

Lobsang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 4, 2022

Hi, recently i started learning rest assured and I encounter strange behaviour.

Basically I created request to create boards with default param on defaultLists = true, then added another request to read from board and finally simple print to see response - every time on single print I get two identical prints of two list containing same items.

String boardName = "Board without lists";

Response creationResponse = given()
.queryParam("key", key)
.queryParam("token", token)
.queryParam("name", boardName)
.queryParam("defaultLists", true)
.contentType(ContentType.JSON)
.when()
.post(url)
.then()
.statusCode(HttpStatus.SC_OK)
.extract()
.response();

JsonPath jPathPost = creationResponse.jsonPath();
idBoard = jPathPost.get("id");

Assertions.assertEquals(boardName, jPathPost.get("name"));

Response getResponse = given()
.queryParam("key", key)
.queryParam("token", token)
.contentType(ContentType.JSON)
.when()
.get(url + "/" + idBoard + "/lists")
.then()
.statusCode(HttpStatus.SC_OK)
.extract()
.response();

System.out.print(getResponse.print());

Any idea why on console I receive two same lists? Checked on postman with same request and i got normal response with one list.

 

Thanks in advance!

1 answer

0 votes
Nicolas Grossi
Banned
June 18, 2024

@Lobsang welcome! Is this question still "active" ?

 

Nicolas

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events