Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,369,925
Community Members
 
Community Events
168
Community Groups

Printing response using rest assured

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!

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events