Questions tagged [rest-assured]

REST Assured is a Java library that provides a domain-specific language (DSL) for writing powerful, maintainable tests for RESTful APIs.

REST Assured enables testing of REST services in Java.

It uses a fluid syntax inspired by similar libraries for and .

2207 questions
0
votes
2 answers

Json request POST rest-assured

please help me to create the body request from the following output: { "categories": [ { "categoryId": "4654-456465-4564", "fields": { "4564654-454646-4564": "Ano", "4564654-454646-4561": "Super" } } ], …
Toyota
  • 33
  • 1
  • 5
0
votes
1 answer

2x array POST request using Rest Assured based on the following JSON

please help me to create the body request from the following output: { "categoryIds": [ [ "4654-456465-4564", "4654-456465-9512" ] ], "lastUpdate": "1231", "controlStructureId": "4654-456465-4564", "controntrolId":…
Toyota
  • 33
  • 1
  • 5
0
votes
1 answer

How to send complex body in the request with rest assured?

How can I send a body like this on request? { "censored1": "String1", "censored2": "String2", "censored3": "String3", "censored4": "String4", "censored5": "String5", "censored6": { "censored7" "YZF2CWsvAbBMd /…
0
votes
2 answers

How to get response body of GET call in RestAPI?

Am new to API testing. I wanted to validated the response body of the GET method. But it is returning the io.restassured.internal.RestAssuredResponseImpl@35adf623 with the below code. Please let me know how can I resolve this. With POST Method, it…
Rahul
  • 759
  • 3
  • 21
  • 43
0
votes
0 answers

How to validate Json text which is not having any property name or key?

Am new to API testing and trying to validate response in 'JSON Text' format which is not having any key or property.Please find below json and let me know how can I validate this.Am reading the same format from another file and trying to validate…
Rahul
  • 759
  • 3
  • 21
  • 43
0
votes
0 answers

Groovy: illegal string body character after dollar sign;

I am working with RestAssured framework in my java project but i got an error from Groovy . I need to find a bunch of elements in my json. My json looks like as below: [ { "city" : "LONDON", "car" : "myCar", "name" : "Jack", "familyName" :…
Jeff
  • 7,767
  • 28
  • 85
  • 138
0
votes
1 answer

Rest Assured Groovy GPath filtering out result

I am trying to return the value of "description" in "dependentPreferences" where the response meets two conditions: First, check if the name is "John Smith" and then check if the "image" in preferences equals to "papaya.jpg". The response body is as…
kokodee
  • 285
  • 1
  • 3
  • 15
0
votes
1 answer

how to clear queryParameters in RestAssured RequestSpecification object?

I have a testcase, where I need to make GET requests in a loop. I'm using RequestSpecification to prepare request, and then make it. I pass new URI in each request in the loop. And I have discovered that RequestSpecification object saves…
Igor Vlasuyk
  • 514
  • 2
  • 10
  • 22
0
votes
1 answer

How to use the regex in rest assured

Like i have to validate in name it should accept only the alphabets value if any numeric value or special char is entered than in response it should give an error. Note i want to use regex on every key.
rachita
  • 31
  • 2
0
votes
2 answers

Getting spring application variables into Integration Tests

I've set up integration tests for testing my API and I want my tests to pick up settings from application.yml. The trouble is that my test class never reads the value of ${base-urls.test-url} from the properties file. I've tried using…
user6495105
0
votes
0 answers

NoClassDefFoundError: io/restassured/RestAssured

I have following problem with test execute from .bat file. I execute my test from .bat file. set projectPath=D:\git\content-generator-tests cd %projectPath% set classpath=%projectPath%\target\classes;%projectPath%\lib\* java org.testng.TestNG…
goney225
  • 91
  • 1
  • 1
  • 10
0
votes
1 answer

POST fails( rest-assured) with nested arrays

I have nested array in the payload for the POST. Trying to run the POST via rest assured but it throws 400 I tried both hashmap and object mapper but couldn't make it work. { "actions": [ { "n": "O", …
Kanna
  • 17
  • 4
0
votes
1 answer

How to pass query params in Get call with rest-assured using cucumber scenario steps

I'm exploring rest-assured (Java) with cucumber based Framework. There is a method written to handle query parameters, it expects a map of as below- protected Response **getByQueryParams**(final String url, Map queryParams) { …
saTya
  • 305
  • 1
  • 5
  • 15
0
votes
2 answers

HP ALM file attachment

I am doing an API automation of hp-alm using REST assured in Java. I'm trying to upload an attachment to a created run instance. urlheaders.put("Content-Type", "multipart/form-data"); File file = new File("H:\\Desktop\\a.zip"); RequestSpecification…
usrdrv
  • 17
  • 4
0
votes
1 answer

How to find the number of nodes within a XML API response?

I'm testing This is the API Endpoint : http://ergast.com/api/f1 What is the best way to find the number (numberOfCircuits) returned for a particular season? The response for a particular season is: