rest-assured Questions
3
I am trying out RestAssured & wrote the following statements -
String URL = "http://XXXXXXXX";
Response result = given().
header("Authorization","Basic xxxx").
contentType("application/json...
Necrology asked 10/11, 2015 at 15:28
8
I am working to setup wiremock for springboot rest api and using rest assured and spring-cloud-starter-contract-stub-runner from spring cloud. when i run the sample integration test i encounter mod...
Tallu asked 5/5, 2022 at 11:17
5
How can I make sure that my response, let's say it is in JSON, either contains or does not contain a specific field?
when()
.get("/person/12345")
.then()
.body("surname", isPresent()) // Doesn't...
Spatterdash asked 27/3, 2017 at 11:31
2
Solved
I'm using REST-Assured for testing some RESTful webservices. Here's my JSON:
{
"status":true,
"responseData":{
"orderLevelReasons":[
{
"reasons":[
{
"reasonId":"129cfea8-b022-4dc8-9811-222a...
Ourself asked 12/4, 2017 at 9:4
5
Solved
I am trying to build a Test Automation Tool for REST API on AWS using rest-assured framework. I just tried with a simple HTTP POST and checking the output JSON body. But when I run that in Eclipse ...
Bulk asked 8/6, 2016 at 23:41
3
i have gone through many help, but all are about explaining on scenario level. Is there any Before and After hook at feature level for cucumber JVM.? This page cucumber Hook tells about ruby langua...
Escuage asked 13/10, 2017 at 16:21
5
Solved
The below test case gives me a connection refused exception and when i comment the method body it is success. So i believe there is no problem with ports but a problem with the rest assured invocat...
Gillis asked 17/8, 2015 at 15:33
5
Example Test:
@Test
public void shouldGetRoutesList() {
Response response =
given()
.headers("RequestId", 10)
.headers("Authorization", accessToken)
.contentType(ContentType.JSON).
expect()
...
Lime asked 21/1, 2016 at 8:53
10
Solved
I'm getting below error:
java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.testing.models.Account
with below code
final int expectedId = 1;
Test newTest = create();
...
Wristlet asked 3/3, 2015 at 0:2
3
Solved
I have problem with making POST request with rest-assured.
This code works:
given().contentType(ContentType.JSON).body("{\"key\": \"val\"}").
when().post(url + resource).then().assertThat().sta...
Linderman asked 13/8, 2015 at 15:29
4
I'd like to know if there is a way of logging all the calls and responses (url + payload) processed by restassured.
THe finality would be to have a "debug" test log with all the calls and traffic ...
Revisory asked 30/10, 2013 at 21:40
4
For example, I have JSON in response:
[{"id":1,"name":"text"},{"id":2,"name":"text"}]}
I want to verify if a response contains a custom object. For example:
Person(id=1, name=text)
I found s...
Flanch asked 16/3, 2018 at 15:43
6
Solved
I have a POJO Artwork. I'm retrieving a List of those objects from a RESTful webservice in the HTTP response body in JSON format. I'm trying to write a Rest Assured-based test that would analyze th...
Jarad asked 12/2, 2014 at 10:24
4
Solved
I have a below JSON string from the below i want to find/search criteria in JSON String.
To find the Number of keys present.
To get the values of given key(if we have array)
{
"store"...
Perishing asked 11/3, 2015 at 9:11
3
Solved
Hi I am not able to resolve the error while using rest assured 4.1.1. library in my Eclipse IDE.
I have added the rest assured library in my pom.xml file still the error is not resolved.
I tried r...
Corrida asked 23/10, 2019 at 4:53
2
Solved
I am using Rest-Assured to test my Rest API.
the webservice seems to be running ok, since running
curl -u "admin:admin" http://localhost:8888/users/
i get my Users as json.
then, when trying...
Africah asked 8/5, 2012 at 14:4
3
Solved
I have @Controller with method with signature like this:
@PostMapping
@ResponseBody
public ResponseEntity<Result> uploadFileAndReturnJson(@RequestParam("file") MultipartFile file) {}
I wan...
Afferent asked 13/12, 2016 at 15:8
3
Solved
I wrote a service which can upload a file to the server, and now I'm writing it's integration test with REST Assured. The functional code is as following:
/* Upload a new document */
@RequestMap...
Grassy asked 14/9, 2016 at 4:27
6
I am new to rest-assured and Java, I am trying to do a very basic test of checking the response is 200 ok for API.
can you any one please tell me what do I need to change in the below script in ord...
Region asked 22/1, 2016 at 0:4
1
So I’m trying to use wiremock to make a post request to a Url with a request body and then get a response back with my respons.json file.(custom response )
This is how I have it set but I can’t see...
Capablanca asked 19/8, 2022 at 9:7
4
I want to send below as a form-data in API Body for a PUT request:
Upload a file(KEY) with "Error.png"(VALUE)
Send text, "MyName"(KEY) with false(VALUE)
How to do this using R...
Mic asked 15/1, 2018 at 11:30
1
Solved
The function contains the API in which I can get the value in JSON format. But I want to get the exact ID=2 which is present in JSON How can I get that data using the Java JSON path.
I have to use ...
Thrave asked 26/4, 2022 at 8:49
5
I have a post request where i need to send x-www-form-urlencoded keyValue pair parameters and content-type should be x-www-form-urlencoded.
Before coding ,i've tried in postman successfully,just a...
Nuisance asked 30/1, 2018 at 6:51
5
I am new to using Rest Assured,Java and Api testing so please be gentle with me. When I use rest assured to test an api that uses Bearer authentication the tests fail resulting in:-
java.net.Conne...
Rallentando asked 14/3, 2017 at 15:25
2
Solved
Trying to automate api testing using Rest assured
@Test
public void Login() {
Response resp = given().
body("{\"phone_number\":\"2222222222\",\"\r\n" +
" + \" \"country_code\": \"+91\",\"\r\n"...
Maines asked 17/9, 2017 at 13:35
1 Next >
© 2022 - 2025 — McMap. All rights reserved.