'String Issue in Rest Assured Post
baseURI = ("");
RestAssured.given()
.contentType("application/json")
.body(z.toString()
"{\n" +
" \"address\": {\n" +
" \"street\": \"AK Haq\",\n" +
" \"country\": \"Pakistan\",\n" +
" \"city\": \"Islamabad\",\n" +
" \"postalCode\": \"J1J2J3\",\n" +
" \"province\": \"KP\",\n" +
" \"majorIntersection\": \"Test Major Intersection\"\n" +
" },\n" +
" \"name\":\" \"ABC\",\n" +
" \"website\": \"www.mailinator.com.\",\n" +
" \"description\": \"Test Description\",\n" +
" \"isActivated\": false,\n" +
" \"isInternal\": false,\n" +
" \"abbreviation\": \"K\",\n" +
" \"logo\": \"culpa sit\"\n" +
"}"
).post("").then()
.log()
.all()
.assertThat()
.statusCode(201);
It gives me the message name, website and description must be a string. I have passed the string but no result was achieved. In the Postman it works fine.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
