REST Assured Objective Questions - Updated
REST Assured Objective Questions - Updated
1) A tester wants to assert a positive and negative test cases for a resource using status
code returned by the server, which following method will help him in fetching the
same? (assume res is the reference for the response object and req is the reference for
the request object returned by the server),
Ans: a) res.getStatusCode()
b) res.getStatusLine()
c) req.getStatusCode()
d) req.getStatusLine()
2) Which of the following patterns are used in Microservices to build a fault tolerant
system when key service has high latency.
Ans: a) API Gateway pattern
b) Circuit Breaker
c) REST Call
d) None of the above
b) close()
c) wb.close()
d) sheet.close()
4) Which of the following statement(s) is/are true about HTTP Request ?
Ans: a) HTTP Request header for containing the information about the data.
b) HTTP Request body that contains the representation of the resources in use
c) Both a and b
d) None of the above
5) Which of the following HTTP method(s) return status code 204 if there is no content in
the body after a successful execution ? (Choose two)
Ans: a) OPTIONS
b) GET
c) DELETE
d) PUT
6) In the following code snippet, identify the correct output after executing the code.
Assume that actual response received is “HTTP/1.1 200 OK”
Response response:
String expResponse = new String(“HTTP/1.1 200 OK”)
response =
RestAssured.get(“http://exampleurl:8081/EDUBank/AccountAPI/getAccount?accountN
umber=44332860268801”);
b) 200 OK
c) HTTP/1.1
d) 1.1 OK
7) Pick the correct set of statements for a monolithic application given below.
(a) A monolithic application is self-contained
(b) It is not possible to scale up a specific functionality
Ans: c, b and e
a, b and c
c, d and e
a, b and d
8) Which of the below database pattern get the data from different microservices and
aggregate them instead of performing table join ?
Ans: a) API composition
b) DB Per service
c) Single DB
d) CQRS
11) Which of the following is the best option for converting the json object returned by the
server into a User defined java object ?
Ans: a) Make use of json path and then get all the key value pairs of the json object and set it to
the corresponding java object as attributes.
b) Make use of getObject(path, ClassName) method of Json path which will automatically
convert it to User defined object java.
c) Make use of get(path) method of Json path which will automatically convert it to User
defined object java.
d) Make use of get(path, ClassName) method of Json path which will automatically convert
it to User defined object java.
12) Which of the following statement(s) is/are true about characteristics of microservices ?
Ans: a) Maintains separate Development and Maintenance Team
13) Which among the below is capable of tracking, discovering and monitoring the
microservices ?
Ans: a) Turbine
b) Sleuth
c) Eureka Dashboard
d) Hystrix
14) Data is coming from one AccountXLS in which 1st column has account number value.
Select the correct code which can get account number from XLS.
Assume that this xls has only one row.
Ans: a) String accno= sheet.getRow(1).getCell(0).getStringCellValue();
b) String accno= sheet.getRow(0).getCell(0).getStringCellValue();
Ans: a) c, a, f and e
b) a, b, e and f
c) c, b, d and e
d) a, b, d and f
b) file type
c) file size
d) file permission
17) It is Possible to import feature files into iFAST to create test case ?
Ans: a) True
b) False
18) A developer wants to create a resource that can provide an interface for the deleting
some of the records from the server, which of the following HTTP method should be
used for achieving the same ?
Ans: a) GET
b) DELETE
c) POST
d) PUT
d) error
d) b, c
21) Rakesh wants response in XML format from the server. What is the header he needs to
create to achieve the same ?
Ans: a) header key = ”Accept” and value=”application/xml”
Ans: a) c, a, f, and e
b) a, b, e, and f
c) c, b, d, and e
d) a, b, d and f
Ans: a) ALM
b) JIRA
c) BugZilla
d) Rational ClearQuest
25) Which tab is used to create & manage external properties like Proxy and Queue in
iFast?
Ans: a) Plan Test
b) manage payload
c) manage configuration
d) Suite
26) In the below code, identify one among the highlighted lines that would be responsible
for unsuccessful execution.
RestAssured.baseURI = http://sampleurl8081/EDUBank/AccountAPI”; Line-1
RequestSpecification request = RestAssured.given((“Content-Type”, “application/xml”); //Line-3
JSON Object reqObj = new JSONObject(Obj.put(“acccountNumber”, “443328602688019”);
reqObj.put(“accountHolderName”, “John A”);
reqObj.put(“ifsc”,”EDUB0000501”);
request.body(reqObj.toString());
Response response = request.post”/accountVerification”); //Line-4); ); // Line-2
Ans: a) Line-1
b) Line- 2
c) Line-3
d) Line 4
28) Which one is not a valid way to create the payload request in iFAst ?
Ans: a) WSDL file fetch
b) Import Swagger
c) JSON request
d) Request File Location
29) Which of the following code will have return type that can contain key-value pairs ?
Ans: a) getHeaders()
b) getStatusCode()
c) getStatusLine()
d) All of the above
Response response;
Response = Rest
Assured.get(“http://exampleurl8081/EDUBank/AccountAPI/getAccount?accountNumber=4433
28602688019”);
e = response.getStatusLine();
Ans: a) result is – OK
b) result is – ok
c) result is – false
d) result is – true
31) Configuration of test data in iFast test case is done in which tab ?
Ans: a) configuration
b) Plan test
c) Data
d) Suite
32) Which of the below testing is done for checking whether microservice is able to respond
back with the right format ?
33) Which among the below deployment pattern if applied may face difficulty in monitoring
resources consumed by different services ?
Ans: a) Single service per container
b) Multiple service per host
c) Single service per host
d) All the above
34) Which of the following statement(s) on XML and JSON is/are correct ? (Choose two)
c) Containers
d) None of the above