add: subtypes tests
This commit is contained in:
parent
6593fcf686
commit
07c7f405e9
27
src/test/java/org/example/SubtypesTest.java
Normal file
27
src/test/java/org/example/SubtypesTest.java
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package org.example;
|
||||||
|
|
||||||
|
import io.restassured.RestAssured;
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static io.restassured.RestAssured.given;
|
||||||
|
import static io.restassured.RestAssured.when;
|
||||||
|
import static org.hamcrest.Matchers.hasSize;
|
||||||
|
|
||||||
|
public class SubtypesTest {
|
||||||
|
|
||||||
|
@BeforeAll
|
||||||
|
public static void subtypesTestSetup() {
|
||||||
|
RestAssured.baseURI = "https://api.magicthegathering.io/v1/subtypes";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getAllSubtypesShouldReturnFourHundredNinetyOneElements(){
|
||||||
|
when().get().then().statusCode(200).body("subtypes", hasSize(491));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getSubtypesWithInvalidPathParamShouldReturnErrorNotFound(){
|
||||||
|
given().pathParam("id", 1).get("/{id}").then().statusCode(404);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user