Skip to content

Instantly share code, notes, and snippets.

@uLucasFraga
Created June 26, 2020 22:27
Show Gist options
  • Save uLucasFraga/624137fb623d0ddea8794e6066bec00f to your computer and use it in GitHub Desktop.
Save uLucasFraga/624137fb623d0ddea8794e6066bec00f to your computer and use it in GitHub Desktop.
Exemplo de teste para Contrato
import org.apache.http.HttpStatus;
import org.junit.Test;
import static io.restassured.RestAssured.when;
import static io.restassured.module.jsv.JsonSchemaValidator.matchesJsonSchemaInClasspath;
public class ExemploContrato {
@Test
public void exemploContratoValidar() {
when()
.get("SUA_URI_AQUI")
.then().statusCode(HttpStatus.SC_OK)
.body(matchesJsonSchemaInClasspath("exemplo-schema.json"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment