This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependencies> | |
<!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured --> | |
<dependency> | |
<groupId>io.rest-assured</groupId> | |
<artifactId>rest-assured</artifactId> | |
<version>3.1.0</version> | |
<scope>test</scope> | |
</dependency> | |
<!-- https://mvnrepository.com/artifact/org.testng/testng --> | |
<dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.testng.annotations.Test; | |
import static io.restassured.RestAssured.get; | |
import static io.restassured.RestAssured.given; | |
import static org.hamcrest.core.IsEqual.equalTo; | |
public class RestAssuredTest { | |
String url = "https://reqres.in/api/users"; | |
@Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jsonschema import validate | |
schema = { | |
"title": "Person", | |
"type": "object", | |
"required": [ "firstName", "lastName" ], | |
"properties": { | |
"firstName": { | |
"type": "string" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sample; | |
import org.json.simple.JSONObject; | |
import org.testng.annotations.Test; | |
import static io.restassured.RestAssured.given; | |
import static io.restassured.RestAssured.when; | |
import static io.restassured.RestAssured.get; | |
import static org.hamcrest.core.IsEqual.equalTo; | |
import static org.hamcrest.CoreMatchers.containsString; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "object", | |
"required": [ | |
"quantidade", | |
"produtos" | |
], | |
"properties": { | |
"quantidade": { | |
"type": "integer", | |
"default": 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-07/schema", | |
"$id": "http://example.com/example.json", | |
"type": "object", | |
"title": "The root schema", | |
"description": "The root schema comprises the entire JSON document.", | |
"default": {}, | |
"examples": [ | |
{ | |
"quantidade": 229, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"info": { | |
"_postman_id": "5e73b0b1-ff8b-4f12-a38b-d159afb7c242", | |
"name": "ServeRest", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "/produtos", | |
"event": [ |