New answers tagged

1

From RestAssured docs, you can do the following: String json = post(URL_TO_CREATE_ENTITY).asString(); String id = from(json).get("generatedId"); // Or whatever is the name of the attribute with the ID Then you can make a call with this value: String urlToDelete = "{baseUrl}/api/product/" + id + "/deleteActivity" delete(...


0

ProductResponse response = when().get("your-endpoint").then().extract().as(ProductResponse.class); Something like above would work. Not sure about this, but if RestAssured uses Jackson to map response to the beans, then you may need to add empty(default) constructors to your POJOS/POGOS.


0

What if the response body returns few id's? few users? how can I test the response to find the exact user I am looking for in the response body? Let's say there is 16 users in the response and only one has first_name: Paul, I want to test if there is a user with Paul as a first_name and return his id? This keep testing only first user. pm.test('Find ...


1

It looks like you need to manually construct your request body using multipart-related content-type and specifying a boundary to split parts entries. Example request structure: --boundary Content-Type: application/json; charset=UTF-8 JSON Metadata --boundary Content-Type: file MIME type File content --boundary-- More information: Testing REST API ...


Top 50 recent answers are included